From 2444e5f985f6bd3c2e7156ec60f1e7a731b0aae3 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 8 Jul 2024 22:39:46 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Nemus=C3=ADm=20shazovat=20web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/personalni/views.py b/personalni/views.py index 5e5ad22c..e7cb4f48 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -4,7 +4,7 @@ from django.views import generic from django.db.models import Q, Count, Min from django.views.decorators.debug import sensitive_post_parameters from django.views.generic.base import TemplateView -from django.contrib.auth.models import User, Permission, Group +from django.contrib.auth.models import User, Permission, Group, AnonymousUser from django.contrib.auth.mixins import LoginRequiredMixin from django.db import transaction from django.http import HttpResponse @@ -318,6 +318,12 @@ def prihlaskaView(request): # Jen hloupé rozhazovátko def profilView(request): user = request.user + if not isinstance(user, AnonymousUser) and m.Osoba.objects.filter(user=user).count() != 1: + # m.Osoba.objects.get() v ostatních views selže + return HttpResponse(render(request, "universal.html", { + 'title': 'Krize identity.', + 'raw_html': r'
Zvláštní pocit, že jo?
[…]
Co to znamená?
— Že ti MaMweb neumí říct, kdo jsi.
A Admin ano?
— V tom je rozdíl.
— Matrix (1999), parafrázováno', + })) if user.has_perm('auth.org'): return OrgoRozcestnikView.as_view()(request) if user.has_perm('auth.resitel'): From ca8e8506b3d11f66823591de7362dc22776f26ea Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 8 Jul 2024 22:52:58 +0200 Subject: [PATCH 2/2] =?UTF-8?q?P=C5=99ebyte=C4=8Dn=C3=A1=20HttpResponse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/personalni/views.py b/personalni/views.py index e7cb4f48..c2712b30 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -320,10 +320,10 @@ def profilView(request): user = request.user if not isinstance(user, AnonymousUser) and m.Osoba.objects.filter(user=user).count() != 1: # m.Osoba.objects.get() v ostatních views selže - return HttpResponse(render(request, "universal.html", { + return render(request, "universal.html", { 'title': 'Krize identity.', 'raw_html': r'
Zvláštní pocit, že jo?
[…]
Co to znamená?
— Že ti MaMweb neumí říct, kdo jsi.
A Admin ano?
— V tom je rozdíl.
— Matrix (1999), parafrázováno', - })) + }) if user.has_perm('auth.org'): return OrgoRozcestnikView.as_view()(request) if user.has_perm('auth.resitel'):