Skip to content

Commit

Permalink
change fn to anon
Browse files Browse the repository at this point in the history
  • Loading branch information
frostyfan109 committed Oct 9, 2024
1 parent 07f0cc2 commit 2c65c6a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions appstore/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ def generate_token():
token = "".join(secrets.choice(ascii_letters + digits) for i in range(256))
return token

def user_token_expires():
return timezone.now() + timedelta(days=31)

def update_user(user):
# as of Django_saml2_auth v3.12.0 does not add email address by default
# to the created use entry in django db according to:
Expand Down Expand Up @@ -55,7 +52,7 @@ class UserIdentityToken(models.Model):
token = models.CharField(max_length=256, unique=True, default=generate_token)
# Optionally, identify the consumer (probably an app) whom the token was generated for.
consumer_id = models.CharField(max_length=256, default=None, null=True)
expires = models.DateTimeField(default=user_token_expires)
expires = models.DateTimeField(default=lambda: timezone.now() + timedelta(days=31))

@property
def valid(self):
Expand Down

0 comments on commit 2c65c6a

Please sign in to comment.