mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user