feat: init polls

This commit is contained in:
sinavir 2025-03-25 03:06:11 +01:00
parent eef16a5b2d
commit e6d2c9f700
No known key found for this signature in database
8 changed files with 14 additions and 2 deletions

0
polls/__init__.py Normal file
View file

1
polls/admin.py Normal file
View file

@ -0,0 +1 @@
# Register your models here.

6
polls/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class PollsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "polls"

View file

1
polls/models.py Normal file
View file

@ -0,0 +1 @@
# Create your models here.

1
polls/tests.py Normal file
View file

@ -0,0 +1 @@
# Create your tests here.

1
polls/views.py Normal file
View file

@ -0,0 +1 @@
# Create your views here.

View file

@ -4,7 +4,10 @@ from django.http import HttpResponseRedirect
class LocalUserOnlyMixin(AccessMixin):
"""Verify that the current user is authenticated."""
"""
Verify that the current user is authenticated and a local user (not SSO
user).
"""
def dispatch(self, request, *args, **kwargs):
if hasattr(request.user, "cas_account"):
@ -13,7 +16,6 @@ class LocalUserOnlyMixin(AccessMixin):
class LocalUserOnlySoftMixin(LocalUserOnlyMixin):
redirect_url = None
reject_message = ""