server/ammicosrv/authentication/models.py
changeset 156 bf4ae7d9a517
parent 149 8e117699857a
--- a/server/ammicosrv/authentication/models.py	Wed Jun 10 15:15:41 2015 +0200
+++ b/server/ammicosrv/authentication/models.py	Wed Jun 10 15:19:07 2015 +0200
@@ -9,7 +9,7 @@
 
 
 class AmmicoUserManager(BaseUserManager):
-    def create_user(self, email, idUser=None, password=None):
+    def create_user(self, email, id_user=None, password=None):
         """
         Creates and saves a User with the given email and password.
         """
@@ -18,20 +18,20 @@
         
         user = self.model(
             email=self.normalize_email(email),
-            idUser=idUser,
+            id_user=id_user,
         )
 
         user.set_password(password)
         user.save(using=self._db)
         return user
 
-    def create_superuser(self, email, password, idUser=None):
+    def create_superuser(self, email, password, id_user=None):
         """
         Creates and saves a superuser with the given email and password.
         """
         user = self.create_user(email,
             password=password,
-            idUser=idUser
+            id_user=id_user
         )
         user.is_admin = True
         user.save(using=self._db)
@@ -40,7 +40,7 @@
 
 class AmmicoUser(AbstractBaseUser):
     email = models.EmailField(verbose_name='email address', max_length=255, unique=True)
-    idUser = models.IntegerField(_('identifiant utilisateur'), blank=True, null=True)
+    id_user = models.IntegerField(_('identifiant utilisateur'), blank=True, null=True)
     is_active = models.BooleanField(default=True)
     is_admin = models.BooleanField(default=False)