Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
10bdab18
Commit
10bdab18
authored
Apr 28, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Account creation with default values for database (tested in docker).
parent
57db20b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
users.py
gargantext/models/users.py
+11
-11
init_accounts.py
init_accounts.py
+2
-2
No files found.
gargantext/models/users.py
View file @
10bdab18
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"""
...
...
init_accounts.py
View file @
10bdab18
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment