mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-14 18:49:42 +00:00
Merge branch 'login' into training
This commit is contained in:
@@ -10,6 +10,7 @@ import simplejson
|
||||
|
||||
from RIGS import models
|
||||
|
||||
|
||||
# Registration
|
||||
class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
|
||||
captcha = ReCaptchaField()
|
||||
@@ -26,24 +27,22 @@ class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
|
||||
raise forms.ValidationError("These initials are already in use. Please supply different initials.")
|
||||
return self.cleaned_data['initials']
|
||||
|
||||
# Login form
|
||||
class LoginForm(AuthenticationForm):
|
||||
captcha = ReCaptchaField(label='Captcha')
|
||||
|
||||
# Login form
|
||||
class PasswordReset(PasswordResetForm):
|
||||
captcha = ReCaptchaField(label='Captcha')
|
||||
|
||||
class ProfileCreationForm(UserCreationForm):
|
||||
|
||||
class ProfileCreationForm(UserCreationForm):
|
||||
class Meta(UserCreationForm.Meta):
|
||||
model = models.Profile
|
||||
|
||||
|
||||
class ProfileChangeForm(UserChangeForm):
|
||||
|
||||
class Meta(UserChangeForm.Meta):
|
||||
model = models.Profile
|
||||
|
||||
|
||||
# Events Shit
|
||||
class EventForm(forms.ModelForm):
|
||||
datetime_input_formats = formats.get_format_lazy("DATETIME_INPUT_FORMATS") + settings.DATETIME_INPUT_FORMATS
|
||||
@@ -134,7 +133,6 @@ class EventForm(forms.ModelForm):
|
||||
for key in items:
|
||||
items[key].save()
|
||||
|
||||
|
||||
return m
|
||||
|
||||
class Meta:
|
||||
|
||||
@@ -177,8 +177,6 @@ class EventTest(LiveServerTestCase):
|
||||
|
||||
username.send_keys("EventTest")
|
||||
password.send_keys("EventTestPassword")
|
||||
self.browser.execute_script(
|
||||
"return jQuery('#g-recaptcha-response').val('PASSED')")
|
||||
submit.click()
|
||||
|
||||
self.assertEqual(self.live_server_url + n, self.browser.current_url)
|
||||
@@ -752,8 +750,6 @@ class IcalTest(LiveServerTestCase):
|
||||
|
||||
username.send_keys("EventTest")
|
||||
password.send_keys("EventTestPassword")
|
||||
self.browser.execute_script(
|
||||
"return jQuery('#g-recaptcha-response').val('PASSED')")
|
||||
submit.click()
|
||||
|
||||
self.assertEqual(self.live_server_url + n, self.browser.current_url)
|
||||
|
||||
@@ -33,7 +33,7 @@ def login(request, **kwargs):
|
||||
else:
|
||||
from django.contrib.auth.views import login
|
||||
|
||||
return login(request, authentication_form=forms.LoginForm)
|
||||
return login(request)
|
||||
|
||||
"""
|
||||
Called from a modal window (e.g. when an item is submitted to an event/invoice).
|
||||
|
||||
@@ -12,12 +12,6 @@
|
||||
<label for="{{ form.password.id_for_label }}">{{ form.password.label }}</label>
|
||||
{% render_field form.password class+="form-control" placeholder=form.password.label %}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="{{ form.captcha.id_for_label }}">{{ form.captcha.label }}</label>
|
||||
<div class="text-center">
|
||||
{{ form.captcha }}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'registration_register' %}" class="btn">Register</a>
|
||||
<a href="{% url 'password_reset' %}" class="btn">Forgotten Password</a>
|
||||
<input type="submit" value="Login" class="btn btn-primary"/>
|
||||
|
||||
Reference in New Issue
Block a user