Commit 26cd4ecf authored by Zack Wong's avatar Zack Wong
Browse files

more changes to account creation

parent 51e912ac
......@@ -5,6 +5,7 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import ldap
import re
import memberdb.models
from datetime import date
from squarepay import dispense
......@@ -100,10 +101,25 @@ def unlock_account(username):
reason = "account unlocked by uccportal on %s" % str(today)
dispense.set_dispense_flag(username, '!disabled', reason)
# Account creation steps:
#
def create_account(member):
username =
log.info("I: creating new account for %s (%s %s)")
# prepend student numbers with 'sn'
if re.fullmatch(r"^2\d{7}$", username):
log.info("I: username is a student number, adding sn prefix")
username = sn + username
# usernames can't begin with a numeric
if re.match(r"^\d", username):
log.error("E: The username %s cannot start with a digit." % username)
return;
return None;
......
......@@ -11,6 +11,9 @@ https://docs.djangoproject.com/en/2.1/ref/settings/
# import local settings
from gms.settings_local import *
# DEBUG ALLOW
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', "130.95.13.36"]
# Application definition
INSTALLED_APPS = (
......
......@@ -110,6 +110,11 @@ PAYMENT_METHODS = [
('', 'No payment')
]
ACCOUNT_STATUS = [
'enabled',
'disabled',
'no account'
]
......@@ -157,8 +162,6 @@ class Member (IncAssocMember):
# account info
def get_account_status(self):
return;
def __str__ (self):
......
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