Commit 10bdab18 authored by delanoe's avatar delanoe

[FIX] Account creation with default values for database (tested in docker).

parent 57db20b1
from django.contrib.auth import models
from gargantext.util.db import *
from datetime import datetime
__all__ = ['User']
class User(Base):
# Do not change!
# The properties below are a reflection of Django's auth module's models.
__tablename__ = models.User._meta.db_table
id = Column(Integer, primary_key=True)
password = Column(String(128))
last_login = DateTime(timezone=False)
id = Column(Integer, primary_key=True)
password = Column(String(128))
is_superuser = Column(Boolean(), default=False)
username = Column(String(30))
first_name = Column(String(30))
last_name = Column(String(30))
email = Column(String(75))
is_staff = Column(Boolean())
is_active = Column(Boolean())
date_joined = DateTime(timezone=False)
is_staff = Column(Boolean(), default=False)
username = Column(String(30))
first_name = Column(String(30), default="")
last_name = Column(String(30), default="")
email = Column(String(75))
is_active = Column(Boolean(), default=True)
last_login = Column(DateTime(timezone=False))
date_joined = Column(DateTime(timezone=False), default=datetime.now)
def contacts(self):
"""get all contacts in relation with the user"""
......
......@@ -73,7 +73,6 @@ def create_user(username, email, user=None, password=None, active=False, notify=
if user is None:
user = User()
user.username = username
user.first_name = username
user.email = email
user.is_active = True
if password is None or password == "":
......@@ -83,7 +82,8 @@ def create_user(username, email, user=None, password=None, active=False, notify=
session.commit()
if notify == True:
notify_user(username, email, password)
pass
#notify_user(username, email, password)
return user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment