Files
PyRIGS/users/urls.py
Arona Jones cbe651957d Create 'upcoming events list' with very limited data
UoN users (with nottingham.ac.uk emails) are allowed to access this page only. Not a huge fan of the implementation, hoping someone (maybe future me) comes up with a less nasty implementation
2023-09-23 19:47:00 +00:00

28 lines
1.4 KiB
Python

from django.conf.urls import include
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import LoginView
from django.urls import path
from django.views.decorators.clickjacking import xframe_options_exempt
from registration.backends.default.views import RegistrationView
from PyRIGS.decorators import permission_required_with_403, not_estates
from users import forms, views
urlpatterns = [
path('user/register/', RegistrationView.as_view(form_class=forms.ProfileRegistrationFormUniqueEmail),
name="registration_register"),
path('user/login/', LoginView.as_view(authentication_form=forms.CheckApprovedForm), name='login'),
path('user/login/embed/', xframe_options_exempt(views.LoginEmbed.as_view()), name='login_embed'),
# User editing
path('user/edit/', not_estates()(views.ProfileUpdateSelf.as_view()),
name='profile_update_self'),
path('user/reset_api_key', not_estates()(views.ResetApiKey.as_view(permanent=False)),
name='reset_api_key'),
path('user/', not_estates()(views.ProfileDetail.as_view()), name='profile_detail'),
path('user/<int:pk>/',
permission_required_with_403('RIGS.view_profile')(views.ProfileDetail.as_view()),
name='profile_detail'),
path('user/', include('django.contrib.auth.urls')),
path('user/', include('registration.backends.default.urls')),
]