Skip to content

Commit

Permalink
Merge pull request #7 from sciris/user-created-modified
Browse files Browse the repository at this point in the history
User created modified
  • Loading branch information
cliffckerr authored Dec 13, 2023
2 parents 1886507 + b6b47f8 commit 578f23c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scirisweb/sw_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def __init__(self, username=None, password=None, displayname=None, email=None,
self.is_active = True # Set the account to be active.
self.is_anonymous = False # The user is not anonymous.
self.is_admin = is_admin # Set whether this user has admin rights.
self.created = sc.now() # Set the creation date (not to be modified)
self.modified = sc.now() # Set the modification date (to be modified)

# Handle the password
if raw_password is not None:
Expand Down Expand Up @@ -108,7 +110,7 @@ def jsonify(self, verbose=False):
'is_anonymous': self.is_anonymous,
'is_admin': self.is_admin,
'created': self.created,
'modified': self.modified[-1]})
'modified': self.modified})
return output


Expand All @@ -125,6 +127,7 @@ def jsonify(self, verbose=False):

def save_user(user):
''' Save the specified user to the DataStore '''
user.modified = sc.now() # Update modification date
app.datastore.saveuser(user)
return None

Expand Down

0 comments on commit 578f23c

Please sign in to comment.