Skip to content

Commit

Permalink
Merge pull request #242 from ArtrenH/main
Browse files Browse the repository at this point in the history
2023-11-22-02
  • Loading branch information
Belissimo-T authored Nov 22, 2023
2 parents 79733c2 + a728816 commit 7095a0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions backend/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def get_base_dict(self):
@dataclasses.dataclass
class PlanDownload(Event):
plan_type: str # Ex: "PlanKl.xml" or "VPlanKl.xml"
date: datetime.date
last_modified: datetime.datetime
file_length: int

Expand Down
10 changes: 5 additions & 5 deletions backend/load_plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ async def get_crawlers(session: aiohttp.ClientSession | None = None,
)
hosting = Hosting.deserialize(data["hosting"])

client = IndiwareStundenplanerClient(hosting, session)

if hosting.creds is not None and hosting.creds.username == "schueler":
logger.warning("* Disabling room and teacher plans because only student creds are available.")
# avoid trying to fetch room and teacher plans if no creds are available
client.teacher_plan_client = None
client.room_plan_client = None
client.teachers_substitution_plan_client = None
hosting.indiware_mobil.rooms = None
hosting.indiware_mobil.teachers = None
hosting.substitution_plan.teachers = None

client = IndiwareStundenplanerClient(hosting, session)

for plan_client in client.substitution_plan_clients:
plan_client.proxy_provider = proxy_provider
Expand Down
2 changes: 1 addition & 1 deletion backend/plan_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def download_indiware_mobil(
)

await timer.submit_async(plan_type=plan_filename, last_modified=plan_response.last_modified,
file_length=len(plan_response.content))
file_length=len(plan_response.content), date=date)

self.cache.store_plan_file(date, revision, plan_response.content, plan_filename)
self.cache.store_plan_file(date, revision, json.dumps(downloaded_file.serialize()),
Expand Down

0 comments on commit 7095a0e

Please sign in to comment.