Skip to content

Commit

Permalink
Fix tomorrow events not sent anymore
Browse files Browse the repository at this point in the history
<br/>  File "/var/www/EventOrganizer/database/manage_users.py", line 99, in list_users
    user['last_login_datetime'] = get_datetime_from_str(user['last_login_datetime'].rstrip('Z')) if user['last_login_datetime'] is not None else None
<br/>KeyError: 'last_login_datetime'
  • Loading branch information
TiTi committed Jan 23, 2023
1 parent 6446fcc commit 761cb33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions back/database/manage_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_user(self, user_id=None, email=None):

if res is not None:
res['creation_datetime'] = get_datetime_from_str(res['creation_datetime'].rstrip('Z'))
res['last_login_datetime'] = get_datetime_from_str(res['last_login_datetime'].rstrip('Z')) if res['last_login_datetime'] is not None else None
res['last_login_datetime'] = get_datetime_from_str(res['last_login_datetime'].rstrip('Z')) if res.get('last_login_datetime') is not None else None
return res

def list_users(self, include_new_and_expired=False, only_admins=False,
Expand Down Expand Up @@ -96,7 +96,7 @@ def list_users(self, include_new_and_expired=False, only_admins=False,

for user in res:
user['creation_datetime'] = get_datetime_from_str(user['creation_datetime'].rstrip('Z'))
user['last_login_datetime'] = get_datetime_from_str(user['last_login_datetime'].rstrip('Z')) if user['last_login_datetime'] is not None else None
user['last_login_datetime'] = get_datetime_from_str(user['last_login_datetime'].rstrip('Z')) if user.get('last_login_datetime') is not None else None
return res
finally:
db.close()
Expand Down Expand Up @@ -271,7 +271,7 @@ def list_users_by_score(self, include_new_and_expired=False):

for user in res:
user['creation_datetime'] = get_datetime_from_str(user['creation_datetime'].rstrip('Z'))
user['last_login_datetime'] = get_datetime_from_str(user['last_login_datetime'].rstrip('Z')) if user['last_login_datetime'] is not None else None
user['last_login_datetime'] = get_datetime_from_str(user['last_login_datetime'].rstrip('Z')) if user.get('last_login_datetime') is not None else None

return res
finally:
Expand Down
5 changes: 1 addition & 4 deletions last_release.md
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
* Email should be case-insensitive
* Trombinoscope is now sorted by user activity
* Discord link
* Fix email weird subject sometimes
* Fix tomorrow events not sent anymore

0 comments on commit 761cb33

Please # to comment.