Working saving of registration data, need this doesn't create the required registration profile though.

Might need to find a way to invoke automatically then just append the new user data to the end.
This commit is contained in:
Tom Price
2015-05-21 16:04:12 +01:00
parent 8b26103776
commit a95dd34bea
3 changed files with 18 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ from django.core import serializers
import simplejson
from django.contrib import messages
import datetime
from registration.views import RegistrationView
from RIGS import models, forms
@@ -33,6 +34,17 @@ def login(request, **kwargs):
return login(request, authentication_form=forms.LoginForm)
class ProfileRegistrationView(RegistrationView):
form_class = forms.ProfileRegistrationFormUniqueEmail
def register(self, request, **form):
model = models.Profile()
for (key,value) in form.items():
setattr(model, key, value)
model.set_password(form['password1'])
model.is_active = False
return model.save()
"""
Called from a modal window (e.g. when an item is submitted to an event/invoice).
May optionally also include some javascript in a success message to cause a load of