2023-06-07 12:08:20 +00:00
|
|
|
from account.forms import LoginUsernameForm
|
|
|
|
from account.views import LoginView
|
2020-11-22 12:21:54 +00:00
|
|
|
import debug_toolbar
|
2015-10-16 17:53:02 +00:00
|
|
|
from django.conf import settings
|
|
|
|
from django.conf.urls.static import static
|
2023-06-07 12:08:20 +00:00
|
|
|
from django.core.exceptions import ValidationError
|
2017-06-26 12:43:58 +00:00
|
|
|
from django.views.generic import RedirectView
|
2015-10-16 17:53:02 +00:00
|
|
|
from django.views.generic import TemplateView
|
2020-11-22 12:21:54 +00:00
|
|
|
from django.urls import include, path
|
2017-10-16 10:53:18 +00:00
|
|
|
from django.contrib.flatpages.views import flatpage
|
2015-10-16 17:53:02 +00:00
|
|
|
|
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
import symposion.views
|
|
|
|
|
2017-02-17 07:36:58 +00:00
|
|
|
|
2023-06-07 12:08:20 +00:00
|
|
|
class CustomLoginForm(LoginUsernameForm):
|
|
|
|
def clean(self):
|
|
|
|
# To use account.forms.LoginEmailForm, we need to enforce unique
|
|
|
|
# emails. Since we probably already have duplicate emails in the system,
|
|
|
|
# we'll defer that to next year.
|
|
|
|
try:
|
|
|
|
super().clean()
|
|
|
|
except ValidationError as e:
|
|
|
|
if '@' in self.cleaned_data['username']:
|
|
|
|
raise ValidationError(
|
|
|
|
f'{e.message} Please login with your username, rather than your email.'
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
2016-02-27 22:55:59 +00:00
|
|
|
urlpatterns = [
|
2023-05-05 01:19:52 +00:00
|
|
|
# Trialling homepage via flatpages.
|
|
|
|
# path('', TemplateView.as_view(template_name="homepage.html")),
|
2023-04-24 03:14:39 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
path('saml2/', include('djangosaml2.urls')),
|
|
|
|
path('admin/', admin.site.urls),
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
path("speaker/", include("symposion.speakers.urls")),
|
|
|
|
path("proposals/", include("symposion.proposals.urls")),
|
|
|
|
path("reviews/", include("symposion.reviews.urls")),
|
|
|
|
path("schedule/", include("symposion.schedule.urls")),
|
|
|
|
path("conference/", include("symposion.conference.urls")),
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
path("teams/", include("symposion.teams.urls")),
|
|
|
|
path('raffle/', include("pinaxcon.raffle.urls")),
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2023-06-07 12:08:20 +00:00
|
|
|
path("account/login/", LoginView.as_view(form_class=CustomLoginForm, template_name='account/login.html'), name="account_login"),
|
2023-04-19 14:00:00 +00:00
|
|
|
path("account/", include("account.urls")),
|
|
|
|
|
2016-09-30 10:46:05 +00:00
|
|
|
# Required by registrasion
|
2020-11-22 12:21:54 +00:00
|
|
|
path('tickets/payments/', include('registripe.urls')),
|
|
|
|
path('tickets/', include('registrasion.urls')),
|
|
|
|
path('nested_admin/', include('nested_admin.urls')),
|
|
|
|
path('checkin/', include('regidesk.urls')),
|
|
|
|
path('pages/', include('django.contrib.flatpages.urls')),
|
|
|
|
|
|
|
|
path('dashboard/', symposion.views.dashboard, name="dashboard"),
|
|
|
|
path('boardingpass', RedirectView.as_view(pattern_name="regidesk:boardingpass")),
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
# Debug Toolbar. Always include to ensure tests work.
|
|
|
|
path('__debug__/', include(debug_toolbar.urls)),
|
|
|
|
]
|
2017-02-17 07:36:58 +00:00
|
|
|
|
2020-11-22 12:21:54 +00:00
|
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|