Commit 65d85494 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

fill first name and last name in invited user registration form

Refs: #1915
parent dcf55476
......@@ -54,7 +54,7 @@ import logging
def get_backend(request):
Return an instance of a registration backend,
Returns an instance of a registration backend,
according to the INVITATIONS_ENABLED setting
(if True returns ```` and if False
returns ````).
......@@ -105,16 +105,20 @@ class InvitationsBackend(object):
request = self.request
formclass = 'ExtendedUserCreationForm'
initial_data = None
if self.invitation:
formclass = 'Invited%s' %formclass
initial_data = None
if request.method == 'GET':
initial_data = {'username':self.invitation.username,
inviter = AstakosUser.objects.get(username=self.invitation.inviter)
initial_data['inviter'] = inviter.realname
if self.invitation:
# create a tmp user with the invitation realname
# to extract first and last name
u = AstakosUser(realname = self.invitation.realname)
initial_data = {'username':self.invitation.username,
elif request.method == 'POST':
initial_data = request.POST
return globals()[formclass](initial_data)
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