git://git.onelab.eu
/
myslice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a536aba
)
Django username must be less than 30 char so we use a hash of email
author
Loic Baron
<loic.baron@lip6.fr>
Wed, 6 Apr 2016 09:47:52 +0000
(11:47 +0200)
committer
Loic Baron
<loic.baron@lip6.fr>
Wed, 6 Apr 2016 09:47:52 +0000
(11:47 +0200)
portal/actions.py
patch
|
blob
|
history
diff --git
a/portal/actions.py
b/portal/actions.py
index
e0dc131
..
516f963
100644
(file)
--- a/
portal/actions.py
+++ b/
portal/actions.py
@@
-4,6
+4,7
@@
from manifoldapi.manifoldapi import execute_query,execute_admin_query
from portal.models import PendingUser, PendingSlice, PendingAuthority, PendingProject, PendingJoin
from unfold.page import Page
from portal.models import PendingUser, PendingSlice, PendingAuthority, PendingProject, PendingJoin
from unfold.page import Page
+import hashlib
import json
from django.contrib.auth.models import User
import json
from django.contrib.auth.models import User
@@
-1285,7
+1286,8
@@
def create_pending_user(wsgi_request, request, user_detail):
msg.send()
# saves the user to django auth_user table [needed for password reset]
msg.send()
# saves the user to django auth_user table [needed for password reset]
- user = User.objects.create_user(request['email'].split('@')[-1], request['email'], request['password'])
+ # Django username must be less than 30 char so we use a hash
+ user = User.objects.create_user(hashlib.sha1(request['email'].hexdigest(), request['email'], request['password'])
# Creating a manifold user
user_id = manifold_add_user(wsgi_request, request)
# Creating a manifold user
user_id = manifold_add_user(wsgi_request, request)