Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User created modified #7

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading