Make the webinterface ready for 2022 #1

Open
seba wants to merge 9 commits from cleanup-and-fixes-2022 into master

9 Commits

Author SHA1 Message Date
Sebastian Lohff f4144633d6 Add link to sourcecode to footer 2022-01-22 19:28:12 +01:00
Sebastian Lohff 1f93f9e7bd Dynamically find currently active Contest
Previously we had a lot of hardcoded contest information in the
templates. Name, ruleset and number of contest are now all taken from
the currently active contest and rendered into the templates. Instead of
an URL containing the current contest name, we just use a generic
/contest/. The API will no longer use "the contest with id=1", but the
currently active contest as well.

The currently active contest is - for now - the contest with the latest
deadline.
2022-01-22 19:22:52 +01:00
Sebastian Lohff 7ae53b6150 Set Django to 4.0.1, add DB migrations
Now that we're somewhat Django4 compatible it's time to advertise our
newfound skill! Not all functionality has been tested, but it is
starting again.
2022-01-22 17:35:57 +01:00
Sebastian Lohff 13afffda02 staticfiles template tag libary is called static 2022-01-22 17:35:57 +01:00
Sebastian Lohff 1f39cc5b40 user.is_authenticated is no longer a method
Apparently this is now a property, so we don't need to call it. We can
just use it.
2022-01-22 17:35:57 +01:00
Sebastian Lohff 933a337eac Fix url config for Django4
url() is no longer available, has to be replaced with path() or
re_path(). For proper include() we also need an app_name specified in
the urls.py we're including.
2022-01-22 17:35:57 +01:00
Sebastian Lohff 635289ed8f Set on_delete for all ForeignKey fields
Can't believe this has not been done yet.
2022-01-22 17:35:57 +01:00
Sebastian Lohff 970a3ae517 Remove some python2 --> python3 leftovers
Remove some __future__ imports and the six compability layer (which was
not mentioned in the requirements.txt anyway).
2022-01-22 17:35:57 +01:00
Sebastian Lohff e5465632b4 Pep8 fixes
Reformat codebase a bit so it is easier to work with.
2022-01-22 17:35:57 +01:00