Polished and fixed custom user model

This commit is contained in:
Keannu Christian Bernasol 2023-06-26 20:36:58 +08:00
parent e19c88527a
commit 87d30a0ecc
6 changed files with 93 additions and 21 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 4.2.2 on 2023-06-26 11:43
# Generated by Django 4.2.2 on 2023-06-26 12:08
import django.contrib.auth.models
import django.contrib.auth.validators
@ -31,8 +31,8 @@ class Migration(migrations.Migration):
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('is_student', models.BooleanField(default=True)),
('is_banned', models.BooleanField(default=False)),
('year_level', models.CharField(blank=True, max_length=50, null=True)),
('semester', models.CharField(blank=True, max_length=50, null=True)),
('year_level', models.CharField(choices=[('1st', '1st year'), ('2nd', '2nd year'), ('3rd', '3rd year'), ('4th', '4th year'), ('5th', '5th Year'), ('Irreg', 'Irregular')], max_length=50)),
('semester', models.CharField(choices=[('1st', '1st semester'), ('2nd', '2nd semester')], max_length=50)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
],

View file

@ -0,0 +1,28 @@
# Generated by Django 4.2.2 on 2023-06-26 12:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='customuser',
name='is_studying',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='customuser',
name='first_name',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='customuser',
name='last_name',
field=models.CharField(max_length=100),
),
]

View file

@ -0,0 +1,18 @@
# Generated by Django 4.2.2 on 2023-06-26 12:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_customuser_is_studying_alter_customuser_first_name_and_more'),
]
operations = [
migrations.AddField(
model_name='customuser',
name='avatar',
field=models.ImageField(null=True, upload_to='images'),
),
]