aboutsummaryrefslogtreecommitdiff
path: root/app/tasks/forumtasks.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-12-25 19:28:32 +0000
committerrubenwardy <rw@rubenwardy.com>2018-12-25 19:28:32 +0000
commit21960f24047bdf64eff99ec955ff2229c49eff50 (patch)
treee5bafd280407fabe863f4d1fbf5b667f02c607e3 /app/tasks/forumtasks.py
parentf94885a58f05864682af5394c1b0c3733d46a305 (diff)
downloadcheatdb-21960f24047bdf64eff99ec955ff2229c49eff50.tar.xz
Add support for using forum profile pictures
Diffstat (limited to 'app/tasks/forumtasks.py')
-rw-r--r--app/tasks/forumtasks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/tasks/forumtasks.py b/app/tasks/forumtasks.py
index 1df6d2b..0a5f028 100644
--- a/app/tasks/forumtasks.py
+++ b/app/tasks/forumtasks.py
@@ -25,7 +25,7 @@ import urllib.request
from urllib.parse import urlparse, quote_plus
@celery.task()
-def checkForumAccount(username, token=None):
+def checkForumAccount(username):
try:
profile = getProfile("https://forum.minetest.net", username)
except OSError:
@@ -47,6 +47,10 @@ def checkForumAccount(username, token=None):
user.github_username = github_username
needsSaving = True
+ pic = profile.avatar
+ needsSaving = needsSaving or pic != user.profile_pic
+ user.profile_pic = pic
+
# Save
if needsSaving:
db.session.commit()