don't change User class
This commit is contained in:
parent
f3c3d7b380
commit
f8c7b82da4
|
@ -181,11 +181,7 @@ class User:
|
|||
entry.loginShell = login_shell
|
||||
self.login_shell = login_shell
|
||||
|
||||
def add_terms(self, terms: List[str] or int):
|
||||
if type(terms) is int:
|
||||
last_term = max([Term(t) for t in self.terms] + [Term.current()-1])
|
||||
terms = [repr(last_term+i) for i in range(1, terms+1)]
|
||||
|
||||
def add_terms(self, terms: List[str]):
|
||||
for term in terms:
|
||||
if not is_valid_term(term):
|
||||
raise Exception('%s is not a valid term' % term)
|
||||
|
@ -196,11 +192,7 @@ class User:
|
|||
self.terms.extend(terms)
|
||||
self.is_club_rep = False
|
||||
|
||||
def add_non_member_terms(self, terms: List[str] or int):
|
||||
if type(terms) is int:
|
||||
last_term = max([Term(t) for t in self.non_member_terms] + [Term.current()-1])
|
||||
terms = [repr(last_term+i) for i in range(1, terms+1)]
|
||||
|
||||
def add_non_member_terms(self, terms: List[str]):
|
||||
for term in terms:
|
||||
if not is_valid_term(term):
|
||||
raise Exception('%s is not a valid term' % term)
|
||||
|
|
Loading…
Reference in New Issue