svthalia / concrexit

Thalia Website built on Django.
https://thalia.nu
Other
22 stars 12 forks source link

Use centralized event status logic in more places #2664

Open ColonelPhantom opened 1 year ago

ColonelPhantom commented 1 year ago

Describe the change

2458 introduced some nice centralized logic for event registration status, but it's not used everywhere yet; for example it is not used for event cards like on the front page. We should implement this in those places too.

Motivation

By doing this we will reduce duplicate logic in our codebase.

Current implementation

Right now we implement the status detection logic separately in multiple places.

Suggested implementation

Use the centralized logic defined in website/events/models/status.py and website/events/services.py.

Additional context

It is useful to look for e.g. is_user_registered and other things that indicate that the event status is used. We should use registration_status instead.

ColonelPhantom commented 1 day ago

Specifically, we should probably do this for