Skip to content

Commit

Permalink
🐛 fix attendance semester order during first semester
Browse files Browse the repository at this point in the history
  • Loading branch information
RustySnek committed Sep 17, 2024
1 parent 13d0bce commit cecb61a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions librus_apix/attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@
```
"""

from typing import List, Dict, Tuple
from dataclasses import dataclass
from typing import Dict, List, Tuple

from bs4 import BeautifulSoup, NavigableString, Tag

from librus_apix.client import Client
from librus_apix.exceptions import ArgumentError, ParseError
from librus_apix.helpers import no_access_check
from librus_apix.exceptions import ParseError, ArgumentError
from dataclasses import dataclass


@dataclass
Expand Down Expand Up @@ -317,5 +319,10 @@ def get_attendance(client: Client, sort_by: str = "all") -> List[List[Attendance
attendance_semesters[semester].append(
_create_attendance(single, semester)
)
# returned reverse so first semester is first. Might break if there is only one semester? but idk
return list(reversed(attendance_semesters))
match semester:
case 0:
return list(attendance_semesters)
case 1:
return list(reversed(attendance_semesters))
case _:
raise ParseError("Couldn't find attendance semester")

0 comments on commit cecb61a

Please sign in to comment.