diff options
| -rw-r--r-- | app/dispatch/templates/dispatch/drivers/detail.html | 6 | ||||
| -rw-r--r-- | app/dispatch/views.py | 4 | ||||
| -rw-r--r-- | app/dispatchAuth/migrations/0002_auto_20171106_2233.py | 20 | ||||
| -rw-r--r-- | app/dispatchAuth/models.py | 2 |
4 files changed, 25 insertions, 7 deletions
diff --git a/app/dispatch/templates/dispatch/drivers/detail.html b/app/dispatch/templates/dispatch/drivers/detail.html index 774ee48..99d9611 100644 --- a/app/dispatch/templates/dispatch/drivers/detail.html +++ b/app/dispatch/templates/dispatch/drivers/detail.html @@ -6,7 +6,7 @@ <div class="row"> <div class="col s12"> <h1> - User: {{object.first_name}} {{object.last_name}} ( {{object.username}} ) + User: {{object.first_name}} {{object.last_name}} ( {{object.email}} ) </h1> </div> </div> @@ -34,10 +34,6 @@ <td>{{object.last_name}}</td> </tr> <tr> - <th>Username:</th> - <td>{{object.username}}</td> - </tr> - <tr> <th>Email:</th> <td>{{object.email}}</td> </tr> diff --git a/app/dispatch/views.py b/app/dispatch/views.py index 5a94775..f52c372 100644 --- a/app/dispatch/views.py +++ b/app/dispatch/views.py @@ -156,8 +156,8 @@ class DriverUpdate(UserPassesTestMixin, UpdateView): # fields = ['username', 'first_name','last_name','email','groups'] fields = [] - default_fields = ['username', 'first_name', 'last_name', 'email'] - superuser_fields = ['username', 'first_name', 'last_name', 'email', + default_fields = ['first_name', 'last_name', 'email'] + superuser_fields = ['first_name', 'last_name', 'email', 'is_active', 'is_superuser'] def set_fields(self, user): diff --git a/app/dispatchAuth/migrations/0002_auto_20171106_2233.py b/app/dispatchAuth/migrations/0002_auto_20171106_2233.py new file mode 100644 index 0000000..fa2f934 --- /dev/null +++ b/app/dispatchAuth/migrations/0002_auto_20171106_2233.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-11-06 22:33 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dispatchAuth', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='id', + field=models.AutoField(primary_key=True, serialize=False), + ), + ] diff --git a/app/dispatchAuth/models.py b/app/dispatchAuth/models.py index 6c90dd0..49e0a41 100644 --- a/app/dispatchAuth/models.py +++ b/app/dispatchAuth/models.py @@ -1,4 +1,5 @@ from django.contrib.auth.models import AbstractUser, AbstractBaseUser, PermissionsMixin, BaseUserManager +from django.core.urlresolvers import reverse from django.db import models # Create your models here. @@ -40,6 +41,7 @@ class UserManager(BaseUserManager): class User(PermissionsMixin, AbstractBaseUser): + id = models.AutoField(primary_key=True) email = models.EmailField(max_length=256, unique=True) first_name = models.CharField(max_length=256) last_name = models.CharField(max_length=256) |
