Commit 5b8a7224 authored by root's avatar root
Browse files

fixed registration bugs

parent a09a26d7
......@@ -12,7 +12,7 @@ https://docs.djangoproject.com/en/2.1/ref/settings/
from gms.settings_local import *
# DEBUG ALLOW
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', "130.95.13.36"]
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', "130.95.13.36","portal.ucc.asn.au"]
# Application definition
......
......@@ -31,7 +31,7 @@ ldap_user_dn = getattr(settings, 'LDAP_USER_SEARCH_DN')
ldap_base_dn = getattr(settings, 'LDAP_BASE_DN')
ldap_bind_dn = getattr(settings, 'LDAP_BIND_DN')
ldap_bind_secret = getattr(settings, 'LDAP_BIND_SECRET')
make_home_cmd = ["sudo", "python3", "root_actions.py"]
make_home_cmd = ["sudo", "/services/uccportal/src/memberdb/root_actions.py"]
make_mail_cmd = 'ssh -i %s [email protected] "/usr/local/mailman/bin/add_members" -r- ucc-announce <<< %[email protected]'
make_mail_key = './mooneye.key'
......
......@@ -157,7 +157,7 @@ class Member (IncAssocMember):
# data to be entered by user and validated (mostly) manually
display_name = models.CharField ('Display name', max_length=200)
username = models.SlugField ('Username', max_length=32, null=True, blank=True, unique=True, validators=[RegexValidator(regex='^[a-z0-9._-]*$')])
username = models.SlugField ('Username', max_length=32, null=True, blank=True, unique=False, validators=[RegexValidator(regex='^[a-z0-9._-]*$')])
phone_number = models.CharField ('Phone number', max_length=20, blank=False, validators=[RegexValidator(regex='^\+?[0-9() -]+$')])
is_student = models.BooleanField ('Student', default=True, blank=True, help_text="Tick this box if you are a current student at a secondary or tertiary institution in WA")
is_guild = models.BooleanField ('UWA Guild member', default=True, blank=True)
......
......@@ -36,7 +36,6 @@ class RegisterRenewForm(MyModelForm):
fields = ['first_name', 'last_name', 'phone_number', 'is_student', 'is_guild', 'id_number', 'id_desc', 'email_address']
error_messages = {
'username': {
'unique': 'This username is already taken, please pick another one.',
'invalid': 'Please pick a username with only lowercase letters and numbers'
}
}
......
#!/bin/python3
import sys
import os
import shutil
......
......@@ -19,7 +19,7 @@ urlpatterns = [
path('admin/logout/', auth_views.LogoutView.as_view(template_name='logout.html')),
# for members to "login" before having created a user account
path('login/<username>/<member_token>/', MemberTokenView.as_view(), name='login_member'),
path('login/<id>/<member_token>/', MemberTokenView.as_view(), name='login_member'),
# email confirmation
path('confirm/<int:pk>/<str:token>/', EmailConfirmView.as_view(), name='email_confirm'),
......
......@@ -148,7 +148,7 @@ class MemberTokenView(View):
try:
member = Member.objects.get(
login_token=kwargs['member_token'],
username=kwargs['username'],
id=kwargs['id'],
created__gte=week_ago
)
except Member.DoesNotExist:
......
Supports Markdown
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