Skip to content

Commit

Permalink
Merge pull request #549 from MTES-MCT/fix-created-at
Browse files Browse the repository at this point in the history
fix(user): set created_today to none if created_at is none
  • Loading branch information
alexisig authored Jul 20, 2024
2 parents 8fbc3ea + c6c3da4 commit ceabc25
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 ceabc25

Please sign in to comment.