Skip to content

Commit

Permalink
chore: set a default time for NextAllowedLoginTime field
Browse files Browse the repository at this point in the history
  • Loading branch information
Salaton committed Nov 20, 2021
1 parent b39e831 commit 6d613b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions mycarehub/users/migrations/0014_alter_user_next_allowed_login.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.2.9 on 2021-11-20 09:02

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('users', '0013_auto_20211119_0628'),
]

operations = [
migrations.AlterField(
model_name='user',
name='next_allowed_login',
field=models.DateTimeField(default=django.utils.timezone.now),
),
]
2 changes: 1 addition & 1 deletion mycarehub/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class User(AbstractUser):

last_successful_login = DateTimeField(null=True, blank=True)
last_failed_login = DateTimeField(null=True, blank=True)
next_allowed_login = DateTimeField(null=True, blank=True)
next_allowed_login = DateTimeField(default=timezone.now)
failed_login_count = IntegerField(default=0)
accepted_terms_of_service = ForeignKey(
TermsOfService, null=True, blank=True, on_delete=PROTECT
Expand Down

0 comments on commit 6d613b6

Please sign in to comment.