Skip to content

Commit 3121d3d

Browse files
committed
Fix errors in assignment2/devhub
1 parent aebe280 commit 3121d3d

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Generated by Django 2.1.7 on 2019-04-19 12:09
2+
3+
import django.contrib.auth.models
4+
import django.contrib.auth.validators
5+
from django.db import migrations, models
6+
import django.utils.timezone
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
('auth', '0009_alter_user_last_name_max_length'),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name='Account',
20+
fields=[
21+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22+
('password', models.CharField(max_length=128, verbose_name='password')),
23+
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
24+
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
25+
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
26+
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
27+
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
28+
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
29+
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
30+
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
31+
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
32+
('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')),
33+
('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')),
34+
],
35+
options={
36+
'verbose_name': 'user',
37+
'verbose_name_plural': 'users',
38+
'abstract': False,
39+
},
40+
managers=[
41+
('objects', django.contrib.auth.models.UserManager()),
42+
],
43+
),
44+
]

assignments/assignment2/devhub-0.1.0/src/account/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ class Account(AbstractUser):
88
More information here:
99
https://docs.djangoproject.com/en/dev/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project
1010
"""
11-
REQUIRED_FIELDS = ['username', 'email']
11+
REQUIRED_FIELDS = ['email']

assignments/assignment2/devhub-0.1.0/src/devhub/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# Application definition
3232

3333
INSTALLED_APPS = [
34-
'account.app.AccountConfig',
34+
'account.apps.AccountConfig',
3535
'django.contrib.admin',
3636
'django.contrib.auth',
3737
'django.contrib.contenttypes',

0 commit comments

Comments
 (0)