don't change User class

This commit is contained in:
Max Erenberg 2022-10-06 17:52:19 -04:00
parent f3c3d7b380
commit f8c7b82da4
1 changed files with 2 additions and 10 deletions

View File

@ -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)