Move mathsoc regex and exception userid's into config
This commit is contained in:
parent
0a35be2386
commit
181419ac7a
|
@ -9,20 +9,18 @@ Displays a list of members for a term that are likely to be paying MathSoc
|
||||||
members; defaults to the current term if term is not given.
|
members; defaults to the current term if term is not given.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
regex = ".*(mat/|vpa/se|computer science|math).*"
|
|
||||||
noinc = [ "dtbartle", "dlgawley", "cpdohert", "mbiggs", "tmyklebu" ]
|
|
||||||
|
|
||||||
def main(self, args):
|
def main(self, args):
|
||||||
regex = re.compile(self.regex)
|
regex = re.compile(members.cfg['mathsoc_regex'])
|
||||||
|
noinc = members.cfg['mathsoc_dont_count'].split(' ')
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
mlist = members.list_term(args[0])
|
mlist = members.list_term(args[0])
|
||||||
else:
|
else:
|
||||||
mlist = members.list_term(terms.current())
|
mlist = members.list_term(terms.current())
|
||||||
dns = mlist.keys()
|
dns = mlist.keys()
|
||||||
dns.sort()
|
dns.sort()
|
||||||
for dn in dns:
|
for dn in dns:
|
||||||
member = mlist[dn]
|
member = mlist[dn]
|
||||||
if member['uid'][0] in self.noinc:
|
if member['uid'][0] in noinc:
|
||||||
continue
|
continue
|
||||||
program = member.get('program', [''])[0]
|
program = member.get('program', [''])[0]
|
||||||
if regex.match(program.lower()) != None:
|
if regex.match(program.lower()) != None:
|
||||||
|
|
|
@ -26,7 +26,8 @@ def configure():
|
||||||
string_fields = [ 'username_regex', 'shells_file', 'server_url',
|
string_fields = [ 'username_regex', 'shells_file', 'server_url',
|
||||||
'users_base', 'groups_base', 'sasl_mech', 'sasl_realm',
|
'users_base', 'groups_base', 'sasl_mech', 'sasl_realm',
|
||||||
'admin_bind_keytab', 'admin_bind_userid', 'realm',
|
'admin_bind_keytab', 'admin_bind_userid', 'realm',
|
||||||
'admin_principal', 'admin_keytab', 'expired_account_email' ]
|
'admin_principal', 'admin_keytab', 'expired_account_email',
|
||||||
|
'mathsoc_regex', 'mathsoc_dont_count' ]
|
||||||
numeric_fields = [ 'min_password_length' ]
|
numeric_fields = [ 'min_password_length' ]
|
||||||
|
|
||||||
# read configuration file
|
# read configuration file
|
||||||
|
|
Loading…
Reference in New Issue