Skip to content

Commit

Permalink
users who are not logged in will go to account creation page
Browse files Browse the repository at this point in the history
  • Loading branch information
aahnik committed Jan 15, 2024
1 parent e1cd8a5 commit d5ca87a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/haps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions src/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions src/users/templates/users/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

<div class="p-6 space-y-4 md:space-y-6 sm:p-8">
<h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white">
Create an account
Create your account
</h1>
<form id="multiStepForm" class="space-y-4 md:space-y-6" method="post">
{% csrf_token %}
Expand Down Expand Up @@ -149,15 +149,15 @@ <h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-
</div>
<div class="mb-4">
<label for="password"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Password</label>
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Set a new Password</label>
<input type="password" name="password1" id="id_password1" value="{{form.password1.value | default:''}}"
placeholder=""
class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
required="" />
</div>
<div class="mb-4">
<label for="confirm-password"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Confirm password</label>
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Confirm your password</label>
<input type="password" name="password2" id="id_password2" value="{{form.password2.value | default:''}}"
placeholder=""
class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
Expand Down

0 comments on commit d5ca87a

Please sign in to comment.