From d5ca87a4264e5547cd4403365294ca8b856b05f7 Mon Sep 17 00:00:00 2001 From: aahnik Date: Mon, 15 Jan 2024 14:48:06 +0530 Subject: [PATCH] users who are not logged in will go to account creation page --- src/haps/views.py | 2 +- src/users/models.py | 1 + src/users/templates/users/register.html | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/haps/views.py b/src/haps/views.py index 0d34153..2a22bbf 100644 --- a/src/haps/views.py +++ b/src/haps/views.py @@ -21,7 +21,7 @@ def haps_item(request: HttpRequest, slug: str): return render(request, "haps/item.html", context=context) -@login_required(login_url="/users/login") +@login_required(login_url="/users/register") def register_for_event(request: HttpRequest, slug: str): event = Event.objects.get(slug=slug) registration = EventRegistration.objects.get_or_create( diff --git a/src/users/models.py b/src/users/models.py index 1818e1a..58d535d 100644 --- a/src/users/models.py +++ b/src/users/models.py @@ -3,6 +3,7 @@ from utils.images import upload_image_to from django.utils.html import format_html from .managers import TempleWebUserManager +from solo.models import SingletonModel class TempleWebUser(AbstractUser): diff --git a/src/users/templates/users/register.html b/src/users/templates/users/register.html index 8a4030b..5adbf47 100644 --- a/src/users/templates/users/register.html +++ b/src/users/templates/users/register.html @@ -53,7 +53,7 @@

- Create an account + Create your account

{% csrf_token %} @@ -149,7 +149,7 @@

+ class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Set a new Password + class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Confirm your password