mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 06:22:16 +00:00
CHANGE: New user signups now require admin approval
Given that I intend to reveal much more data to new users this seems necessary...
This commit is contained in:
@@ -4,6 +4,7 @@ from django.conf import settings
|
||||
from django.core import serializers
|
||||
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AuthenticationForm, PasswordResetForm
|
||||
from registration.forms import RegistrationFormUniqueEmail
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from captcha.fields import ReCaptchaField
|
||||
import simplejson
|
||||
|
||||
@@ -54,6 +55,13 @@ class ProfileChangeForm(UserChangeForm):
|
||||
model = models.Profile
|
||||
|
||||
|
||||
class CheckApprovedForm(AuthenticationForm):
|
||||
def confirm_login_allowed(self, user):
|
||||
if not user.is_approved:
|
||||
raise forms.ValidationError("Your account hasn't been approved by an administrator yet. Please check back in a few minutes!")
|
||||
return AuthenticationForm.confirm_login_allowed(self, user)
|
||||
|
||||
|
||||
# Events Shit
|
||||
class EventForm(forms.ModelForm):
|
||||
datetime_input_formats = formats.get_format_lazy("DATETIME_INPUT_FORMATS") + list(settings.DATETIME_INPUT_FORMATS)
|
||||
|
||||
Reference in New Issue
Block a user