From 69c60a031ca6b2dae1f43cf46ebab8821b632850 Mon Sep 17 00:00:00 2001
From: FelixFrizzy <39409092+FelixFrizzy@users.noreply.github.com>
Date: Fri, 5 Sep 2025 14:35:09 +0200
Subject: [PATCH 2/3] Fix error when mail not configured
- Send mail is only triggered when mail is configered
---
README.md | 2 +-
evoks/evoks/settings.py | 1 +
evoks/evoks/views.py | 19 ++++++++++---------
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 159e2ab..b11e7e1 100755
--- a/README.md
+++ b/README.md
@@ -90,7 +90,7 @@ Most of it is already implemented, you should at least do the following:
# Further settings (not needed for initial setup)
## Configure Mail Server
1. Open .env file
-2. Fill out
+2. Add
```
EMAIL_HOST_USER=your-email
EMAIL_HOST_PASSWORD=your-password
diff --git a/evoks/evoks/settings.py b/evoks/evoks/settings.py
index 36304eb..a1f787e 100755
--- a/evoks/evoks/settings.py
+++ b/evoks/evoks/settings.py
@@ -94,6 +94,7 @@ def get_env(key, fallback):
EMAIL_USE_TLS = True
EMAIL_HOST_USER = get_env('EMAIL_HOST_USER', '')
EMAIL_HOST_PASSWORD = get_env('EMAIL_HOST_PASSWORD', '')
+EMAIL_CONFIGURED = bool(EMAIL_HOST_USER and EMAIL_HOST_PASSWORD)
diff --git a/evoks/evoks/views.py b/evoks/evoks/views.py
index 4f3d8eb..7cb8e85 100755
--- a/evoks/evoks/views.py
+++ b/evoks/evoks/views.py
@@ -12,7 +12,7 @@
from django.shortcuts import redirect
from django.contrib.auth.models import User
from django.core.mail import send_mail
-from evoks.settings import EMAIL_HOST_USER
+from evoks.settings import EMAIL_HOST_USER, EMAIL_CONFIGURED
import django.contrib.auth.views
from django.contrib.auth.models import User
from django.contrib import admin
@@ -103,14 +103,15 @@ def signup_view(request: HttpRequest) -> HttpResponse:
url = request.build_absolute_uri(reverse("admin:%s_%s_change" % (
user.profile._meta.app_label, user.profile._meta.model_name), args=(user.profile.id,)))
- send_mail(
- 'Verify a new Evoks account',
- 'Please visit the evoks admin panel {0} and verify the new user'.format(
- url),
- EMAIL_HOST_USER,
- emails,
- fail_silently=False,
- )
+ if EMAIL_CONFIGURED:
+ send_mail(
+ 'Verify a new Evoks account',
+ 'Please visit the evoks admin panel {0} and verify the new user'.format(
+ url),
+ EMAIL_HOST_USER,
+ emails,
+ fail_silently=False,
+ )
return HttpResponse('Your account will be usable as soon as an admin verifies it!')
From 7bf11763942e6299927eda4b75aa0b6811af274a Mon Sep 17 00:00:00 2001
From: FelixFrizzy <39409092+FelixFrizzy@users.noreply.github.com>
Date: Mon, 27 Oct 2025 09:47:10 +0100
Subject: [PATCH 3/3] Show top concepts in skosmos hierarchy by default
---
evoks/Skosmos/skosmos.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/evoks/Skosmos/skosmos.py b/evoks/Skosmos/skosmos.py
index 4df79d5..377c68a 100755
--- a/evoks/Skosmos/skosmos.py
+++ b/evoks/Skosmos/skosmos.py
@@ -61,6 +61,9 @@ def add_vocabulary(self, config: SkosmosVocabularyConfig) -> None:
g.add((URIRef(vocabulary_uri),
URIRef('http://purl.org/net/skosmos#fullAlphabeticalIndex'), Literal(True)))
+ g.add((URIRef(vocabulary_uri),
+ URIRef('http://purl.org/net/skosmos#showTopConcepts'), Literal(True)))
+
g.add((URIRef(vocabulary_uri),
URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), URIRef('http://purl.org/net/skosmos#Vocabulary')))