Skip to content

Commit

Permalink
fix(user): set created_today to none if created_at is none
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisig committed Jul 20, 2024
1 parent 722d77e commit c6c3da4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def __str__(self):

@property
def created_today(self):
if not self.created_at:
return False
return self.created_at.date() == timezone.now().date()

def save(self, *args, **kwargs):
Expand Down

0 comments on commit c6c3da4

Please sign in to comment.