Closed yaxollum closed 2 years ago
sorry for poking after you have made changes, but is it ok to get rid of get_current()
altogether and put a constant in config.py
for the host? (this is what we did for another site: https://github.com/mcpt/ctf/blob/7c7e396907c5bd24652e128da01d0dd272a10997/gameserver/templatetags/markdown_tags.py#L38 (also this might be faster? it is clearer though)
@nyiyui Yeah that would also work. Could you pls make the changes?
@nyiyui Yeah that would also work. Could you pls make the changes?
yes! (i'll try to do this week)
This fixes the failing GitHub Actions check.
When
Site.objects.get_current()
is put into the global scope, it gets evaluated wheneverpython manage.py <any command>
is run. This is fine when a database has already been built with information about the current site, but when there is no database (when running the tests using GitHub Actions or when doing a fresh install of metropolis), there is an error:By moving the call to
Site.objects.get_current()
into a function, this error can be prevented.