Skip to content
Snippets Groups Projects
Commit 12126a6a authored by Alexa Valentová's avatar Alexa Valentová
Browse files

fix lecture query

parent 5565b811
Branches
No related tags found
1 merge request!2Release
Pipeline #20131 passed
...@@ -7,3 +7,4 @@ shared/static/shared/*.js ...@@ -7,3 +7,4 @@ shared/static/shared/*.js
shared/static/shared/*.css shared/static/shared/*.css
shared/static/shared/*.txt shared/static/shared/*.txt
media/* media/*
.venv
\ No newline at end of file
...@@ -2,7 +2,7 @@ DATABASE_URL="postgresql://ucebnice:ucebnice@localhost:5432/ucebnice" ...@@ -2,7 +2,7 @@ DATABASE_URL="postgresql://ucebnice:ucebnice@localhost:5432/ucebnice"
SECRET_KEY=supersecret SECRET_KEY=supersecret
SITE_URL="http://localhost:8013" SITE_URL="http://localhost:8014"
OIDC_RP_REALM_URL="http://localhost:8080/realms/master/" OIDC_RP_REALM_URL="http://localhost:8080/realms/master/"
OIDC_RP_CLIENT_ID=ucebnice OIDC_RP_CLIENT_ID=ucebnice
......
...@@ -182,7 +182,7 @@ class Lecture(NameStrMixin, models.Model): ...@@ -182,7 +182,7 @@ class Lecture(NameStrMixin, models.Model):
return LectureGroupType.objects.filter( return LectureGroupType.objects.filter(
lecture=self, lecture=self,
group__in=( group__in=(
LectureGroup.filter( LectureGroup.objects.filter(
models.Q(user_groups__in=request.user.groups.all()) models.Q(user_groups__in=request.user.groups.all())
if not request.user.is_superuser if not request.user.is_superuser
else models.Q(id__isnull=False) # Always True else models.Q(id__isnull=False) # Always True
......
...@@ -6,7 +6,7 @@ import sys ...@@ -6,7 +6,7 @@ import sys
def main(): def main():
"""Run administrative tasks.""" """Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ucebnice.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ucebnice.settings.dev")
try: try:
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line
except ImportError as exc: except ImportError as exc:
......
...@@ -11,6 +11,6 @@ import os ...@@ -11,6 +11,6 @@ import os
from django.core.asgi import get_asgi_application 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() application = get_asgi_application()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment