Skip to content

Commit

Permalink
fix bug when ephios is not installed as a package when developing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Aug 2, 2023
1 parent 772f51d commit 6bf55e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ephios/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
DEBUG = env.bool("DEBUG")
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")

EPHIOS_VERSION = importlib_metadata.version("ephios")
try:
EPHIOS_VERSION = importlib_metadata.version("ephios")
except importlib_metadata.PackageNotFoundError:
# ephios is not installed as a package (e.g. development setup)
pass

if not DEBUG:
SESSION_COOKIE_SECURE = True
Expand Down
2 changes: 1 addition & 1 deletion ephios/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
{% blocktranslate trimmed with brand='<a href="https://ephios.de/" rel="noreferrer" target="_blank">ephios</a>' %}
powered by {{ brand }}
{% endblocktranslate %}
<samp>{{ ephios_version|default_if_none:"" }}</samp>
<samp>v{{ ephios_version|default_if_none:"" }}</samp>
</span>
</small>
</div>
Expand Down

0 comments on commit 6bf55e0

Please sign in to comment.