Skip to content

Commit b5342b0

Browse files
committed
Image Hotfix pt.2
1 parent 9422ff4 commit b5342b0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packet/context_processors.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,19 @@ def get_rit_name(username):
5151
return username
5252

5353

54+
# pylint: disable=bare-except
5455
@lru_cache(maxsize=128)
5556
def get_rit_image(username):
5657
if username:
5758
addresses = [username + "@rit.edu", username + "@g.rit.edu"]
5859
for addr in addresses:
5960
url = "https://gravatar.com/avatar/" + hashlib.md5(addr.encode("utf8")).hexdigest() + ".jpg?d=404&s=250"
60-
gravatar = urllib.request.urlopen(url)
61-
if gravatar.getcode() == 200:
62-
return url
61+
try:
62+
gravatar = urllib.request.urlopen(url)
63+
if gravatar.getcode() == 200:
64+
return url
65+
except:
66+
continue
6367
return "https://www.gravatar.com/avatar/freshmen?d=mp&f=y"
6468

6569

packet/static/js/tables.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ $(document).ready(function () {
33
$('#active_packets_table').DataTable({
44
"searching": true,
55
"order": [],
6+
"scrollX": false,
67
"paging": false,
78
"info": false,
89
"columnDefs": [

0 commit comments

Comments
 (0)