Skip to content

Commit

Permalink
Update models.py
Browse files Browse the repository at this point in the history
reformat models for prospector
  • Loading branch information
AndreasDickow authored Oct 25, 2023
1 parent 5b47de6 commit be0785a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions axes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ class AccessBase(models.Model):

attempt_time = models.DateTimeField(_("Attempt Time"), auto_now_add=False)

def save(self, *args, **kwargs):
if self.pk is None or self.attempt_time is None:
self.attempt_time = timezone.now()
return super().save(*args, **kwargs)

class Meta:
app_label = "axes"
abstract = True
ordering = ["-attempt_time"]

def save(self, *args, **kwargs):
if self.pk is None or self.attempt_time is None:
self.attempt_time = timezone.now()
return super().save(*args, **kwargs)


class AccessFailureLog(AccessBase):
locked_out = models.BooleanField(
Expand Down

0 comments on commit be0785a

Please sign in to comment.