Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
cstefc committed Mar 10, 2024
1 parent 02cf78d commit 5202750
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions backend/controllers/auth/authentication_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
props: Properties = Properties()


# TODO: Should return a user object instead of a dict
def authenticate_user(session: Session, ticket: str) -> UserDataclass | None:
"""
This function will authenticate the user.
Expand Down Expand Up @@ -60,7 +59,6 @@ def parse_cas_xml(xml: str) -> dict | None:
email: str = attributes_xml.find(f"{namespace}mail").text
role: str = attributes_xml.findall(f"{namespace}objectClass")

# TODO: Checking if there are other roles that need to be added
role_str: str = ""
for r in role:
if r.text == "ugentStudent" and role_str == "":
Expand Down
1 change: 0 additions & 1 deletion backend/domain/logic/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def get_user_with_email(session: Session, email: str) -> UserDataclass | None:
users = [r.to_domain_model() for r in result.scalars()]

if len(users) > 1:
# TODO good error for more than 1 user with same email
raise NotImplementedError

if len(users) == 1:
Expand Down
1 change: 0 additions & 1 deletion backend/routes/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def login(
return Response(status_code=401, content="Invalid Ticket!")


# TODO proper handle logout
@login_router.get("/logout")
def logout() -> Response:
"""
Expand Down
2 changes: 1 addition & 1 deletion backend/routes/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_current_user(
session: Session = Depends(get_session),
) -> APIUser | None:
token: str | None = request.cookies.get("token")
if token =="undefined":
if token is None:
response.status_code = 401
return None
user_id: int | None = verify_token(token)
Expand Down

0 comments on commit 5202750

Please sign in to comment.