Skip to content

Commit

Permalink
fix(verify): external employees
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdragun committed Sep 5, 2024
1 parent cca4523 commit 7175a0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions features/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ def transform_year(raw_year: str):
return "2MIT+" if year_value >= 2 else f"{year_value}MIT"
elif year_parts[1] in ["DVI4", "DRH", "DITP", "DITP-EN"]:
return "Doktorand"
elif year_parts[0] == "employee":
return "Vyucujici/Zamestnanec FIT"
elif year_parts[0] in ["employee", "external employee"]:
return "Vyucujici/Zamestnanec"
elif year_parts[0] in FACULTY_NAMES:
# Other VUT faculties
return "VUT"
Expand Down
9 changes: 6 additions & 3 deletions features/verify_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ async def _parse_relation(self, user: dict) -> str | None:
# do not return yet if not FIT, check for all relations if student has multiple studies
if relation["fakulta"]["zkratka"] == "FIT":
return ret
elif "fakulta" in relation.keys() and relation["fakulta"]["zkratka"] == "FIT":
# FIT employee, replace only if not student
ret = ret or "employee"
elif "fakulta" in relation.keys():
if relation["fakulta"]["zkratka"] == "FIT":
# FIT employee, replace only if not student
ret = ret or "employee"
else:
ret = ret or "external employee"
if not ret:
await self.log_relation_error(user)
return ret
Expand Down

0 comments on commit 7175a0f

Please sign in to comment.