Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetam-Das26 committed Feb 4, 2024
1 parent 29a0634 commit f58bee8
Show file tree
Hide file tree
Showing 6 changed files with 2,635 additions and 5 deletions.
Binary file added instance/mscolab.db
Binary file not shown.
2 changes: 1 addition & 1 deletion mslib/mscolab/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, emailid, username, password, confirmed=False, confirmed_on=No
self.username = username
self.emailid = emailid
self.hash_password(password)
self.registered_on = datetime.datetime.now()
self.registered_on = datetime.datetime.now(tz=datetime.timezone.utc)
self.confirmed = confirmed
self.confirmed_on = confirmed_on
self.authentication_backend = authentication_backend
Expand Down
4 changes: 2 additions & 2 deletions mslib/mscolab/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def create_or_update_idp_user(email, username, token, authentication_backend):
user = User.query.filter_by(emailid=email).first()
if not user:
# using an IDP for a new account/profile, e-mail is already verified by the IDP
confirm_time = datetime.datetime.now() + datetime.timedelta(seconds=1)
confirm_time = datetime.datetime.now(tz=datetime.timezone.utc) + datetime.timedelta(seconds=1)
user = User(email, username, password=token, confirmed=True, confirmed_on=confirm_time,
authentication_backend=authentication_backend)
result = fm.modify_user(user, action="create")
Expand Down Expand Up @@ -337,7 +337,7 @@ def confirm_email(token):
if user.confirmed:
return render_template('user/confirmed.html', username=user.username)
else:
fm.modify_user(user, attribute="confirmed_on", value=datetime.datetime.now())
fm.modify_user(user, attribute="confirmed_on", value=datetime.datetime.now(tz=datetime.timezone.utc))
fm.modify_user(user, attribute="confirmed", value=True)
return render_template('user/confirmed.html', username=user.username)

Expand Down
Loading

0 comments on commit f58bee8

Please sign in to comment.