From 12126a6a136ef2e0f2d4078dc29ac6b52469206c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org>
Date: Fri, 22 Nov 2024 12:43:20 +0100
Subject: [PATCH 1/2] fix lecture query

---
 .gitignore         | 1 +
 env.example        | 2 +-
 lectures/models.py | 2 +-
 manage.py          | 2 +-
 ucebnice/asgi.py   | 2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8220b2e..42c64d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ shared/static/shared/*.js
 shared/static/shared/*.css
 shared/static/shared/*.txt
 media/*
+.venv
\ No newline at end of file
diff --git a/env.example b/env.example
index baea7fb..245514c 100644
--- a/env.example
+++ b/env.example
@@ -2,7 +2,7 @@ DATABASE_URL="postgresql://ucebnice:ucebnice@localhost:5432/ucebnice"
 
 SECRET_KEY=supersecret
 
-SITE_URL="http://localhost:8013"
+SITE_URL="http://localhost:8014"
 
 OIDC_RP_REALM_URL="http://localhost:8080/realms/master/"
 OIDC_RP_CLIENT_ID=ucebnice
diff --git a/lectures/models.py b/lectures/models.py
index 1979f4e..beb6b70 100644
--- a/lectures/models.py
+++ b/lectures/models.py
@@ -182,7 +182,7 @@ class Lecture(NameStrMixin, models.Model):
             return LectureGroupType.objects.filter(
                 lecture=self,
                 group__in=(
-                    LectureGroup.filter(
+                    LectureGroup.objects.filter(
                         models.Q(user_groups__in=request.user.groups.all())
                         if not request.user.is_superuser
                         else models.Q(id__isnull=False)  # Always True
diff --git a/manage.py b/manage.py
index 701b8e3..7441d7c 100755
--- a/manage.py
+++ b/manage.py
@@ -6,7 +6,7 @@ import sys
 
 def main():
     """Run administrative tasks."""
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ucebnice.settings")
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ucebnice.settings.dev")
     try:
         from django.core.management import execute_from_command_line
     except ImportError as exc:
diff --git a/ucebnice/asgi.py b/ucebnice/asgi.py
index 97f0093..bed8a8d 100644
--- a/ucebnice/asgi.py
+++ b/ucebnice/asgi.py
@@ -11,6 +11,6 @@ import os
 
 from django.core.asgi import get_asgi_application
 
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "registry.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ucebnice.settings.dev")
 
 application = get_asgi_application()
-- 
GitLab


From bb3e46f207783db1b7663d1fff4c923dcb44efce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org>
Date: Fri, 22 Nov 2024 12:43:34 +0100
Subject: [PATCH 2/2] run hooks

---
 .gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 42c64d4..63c0028 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,4 @@ shared/static/shared/*.js
 shared/static/shared/*.css
 shared/static/shared/*.txt
 media/*
-.venv
\ No newline at end of file
+.venv
-- 
GitLab