Skip to content

Commit 77f7d0e

Browse files
committed
Revert "chom (#406)"
This reverts commit 8a6b501.
1 parent 597e54c commit 77f7d0e

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

conditional/util/context_processors.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# pylint: disable=bare-except
22

3-
import hashlib
4-
import urllib
5-
63
from conditional import app
74
from conditional.models.models import FreshmanAccount
85
from conditional.util.cache import service_cache
@@ -34,31 +31,11 @@ def check_current_student(username):
3431
return ldap_is_current_student(member)
3532

3633

37-
@service_cache(maxsize=256)
38-
def get_rit_image(username: str) -> str:
39-
if username:
40-
addresses = [username + "@rit.edu", username + "@g.rit.edu"]
41-
for addr in addresses:
42-
url = (
43-
"https://gravatar.com/avatar/"
44-
+ hashlib.md5(addr.encode("utf8")).hexdigest()
45-
+ ".jpg?d=404&s=250"
46-
)
47-
try:
48-
with urllib.request.urlopen(url) as gravatar:
49-
if gravatar.getcode() == 200:
50-
return url
51-
except:
52-
continue
53-
return "https://www.gravatar.com/avatar/freshmen?d=mp&f=y"
54-
55-
5634
@app.context_processor
5735
def utility_processor():
5836
return {
5937
"get_csh_name": get_csh_name,
6038
"get_freshman_name": get_freshman_name,
61-
"get_rit_image": get_rit_image,
6239
"get_member_name": get_member_name,
6340
"check_current_student": check_current_student,
6441
}

0 commit comments

Comments
 (0)