move term check to LDAPService instead of User constructor

This commit is contained in:
Max Erenberg 2021-11-02 01:27:14 -04:00
parent dbbc533111
commit 729f443e72
4 changed files with 9 additions and 3 deletions

View File

@ -1 +1 @@
1.0.1
1.0.2

View File

@ -171,6 +171,8 @@ class LDAPService:
else:
assert user.given_name and user.sn, \
'First name and last name must be specified for new members'
assert user.terms or user.non_member_terms, \
'terms and non_member_terms cannot both be empty'
min_id, max_id = self.member_min_id, self.member_max_id
object_classes.append('member')
if user.mail_local_addresses:

View File

@ -33,8 +33,6 @@ class User:
is_club: bool = False,
ldap3_entry: Union[ldap3.Entry, None] = None,
):
if not is_club and not terms and not non_member_terms:
raise Exception('terms and non_member_terms cannot both be empty')
cfg = component.getUtility(IConfig)
self.uid = uid

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
ceo (1.0.2-buster1) buster; urgency=medium
* Put term check into LDAPService.
-- Max Erenberg <merenber@csclub.uwaterloo.ca> Tue, 02 Nov 2021 05:29:00 +0000
ceo (1.0.1-buster1) buster; urgency=high
* Add cryptography package to requirements.txt