From 5840d3f95c576a34d03523cd4b08d14187dca169 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Tue, 4 Jul 2023 19:36:29 +0800 Subject: [PATCH] Make users not active by default, requiring email activation --- .../0005_alter_customuser_is_active.py | 18 ++++++++++++++++++ stude/accounts/models.py | 1 + stude/config/settings.py | 1 + 3 files changed, 20 insertions(+) create mode 100644 stude/accounts/migrations/0005_alter_customuser_is_active.py diff --git a/stude/accounts/migrations/0005_alter_customuser_is_active.py b/stude/accounts/migrations/0005_alter_customuser_is_active.py new file mode 100644 index 0000000..f6ebd78 --- /dev/null +++ b/stude/accounts/migrations/0005_alter_customuser_is_active.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.2 on 2023-07-04 11:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0004_alter_customuser_course_alter_customuser_semester_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='customuser', + name='is_active', + field=models.BooleanField(default=False), + ), + ] diff --git a/stude/accounts/models.py b/stude/accounts/models.py index 80565bf..02b18fc 100644 --- a/stude/accounts/models.py +++ b/stude/accounts/models.py @@ -33,6 +33,7 @@ class CustomUser(AbstractUser): # Username inherited from base user class # Password inherited from base user class # is_admin inherited from base user class + is_active = models.BooleanField(default=False) is_student = models.BooleanField(default=True) is_studying = models.BooleanField(default=False) is_banned = models.BooleanField(default=False) diff --git a/stude/config/settings.py b/stude/config/settings.py index dcc63f8..c31d26f 100644 --- a/stude/config/settings.py +++ b/stude/config/settings.py @@ -196,4 +196,5 @@ if (DEBUG): else: DOMAIN = 'stude' + SITE_NAME = 'Stud-E'