Move mathsoc regex and exception userid's into config
This commit is contained in:
parent
0a35be2386
commit
181419ac7a
|
@ -9,11 +9,9 @@ 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.
|
||||
'''
|
||||
|
||||
regex = ".*(mat/|vpa/se|computer science|math).*"
|
||||
noinc = [ "dtbartle", "dlgawley", "cpdohert", "mbiggs", "tmyklebu" ]
|
||||
|
||||
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:
|
||||
mlist = members.list_term(args[0])
|
||||
else:
|
||||
|
@ -22,7 +20,7 @@ members; defaults to the current term if term is not given.
|
|||
dns.sort()
|
||||
for dn in dns:
|
||||
member = mlist[dn]
|
||||
if member['uid'][0] in self.noinc:
|
||||
if member['uid'][0] in noinc:
|
||||
continue
|
||||
program = member.get('program', [''])[0]
|
||||
if regex.match(program.lower()) != None:
|
||||
|
|
|
@ -26,7 +26,8 @@ def configure():
|
|||
string_fields = [ 'username_regex', 'shells_file', 'server_url',
|
||||
'users_base', 'groups_base', 'sasl_mech', 'sasl_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' ]
|
||||
|
||||
# read configuration file
|
||||
|
|
Loading…
Reference in New Issue