Skip to content

Commit

Permalink
new touch operation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jun 27, 2016
1 parent d0d22fa commit b812628
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/appier_extras/parts/admin/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,6 @@ def pre_save(self):
if hasattr(self, "password") and self.password:
self.password = self.encrypt(self.password)

def touch_s(self):
# updates the last login of the account with the current timestamp
# and saves the account so that this value is persisted
self.last_login = time.time()
self.save()

def confirm_s(self, send_email = False):
self.confirmation_token = None
self.enabled = True
Expand Down Expand Up @@ -565,6 +559,13 @@ def email_f(self):
if not self.username: return self.email
return "%s <%s>" % (self.username, self.email)

@appier.operation(name = "Touch")
def touch_s(self):
# updates the last login of the account with the current timestamp
# and saves the account so that this value is persisted
self.last_login = time.time()
self.save()

@appier.operation(name = "Generate Key")
def generate_key_s(self, force = False):
self = self.reload(rules = False)
Expand Down

0 comments on commit b812628

Please sign in to comment.