Coverage for ivatar/ivataraccount/urls.py: 100%
19 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +0000
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +0000
1# -*- coding: utf-8 -*-
2"""
3URLs for ivatar.ivataraccount
4"""
5from django.urls import path, re_path
7from django.contrib.auth.views import LogoutView
8from django.contrib.auth.views import (
9 PasswordResetDoneView,
10 PasswordResetConfirmView,
11 PasswordResetCompleteView,
12)
13from django.contrib.auth.views import PasswordChangeView, PasswordChangeDoneView
15from .views import ProfileView, PasswordResetView
16from .views import CreateView, PasswordSetView, AddEmailView
17from .views import RemoveUnconfirmedEmailView, ConfirmEmailView
18from .views import RemoveConfirmedEmailView, AssignPhotoEmailView
19from .views import RemoveUnconfirmedOpenIDView, RemoveConfirmedOpenIDView
20from .views import ImportPhotoView, RawImageView, DeletePhotoView
21from .views import UploadPhotoView, AssignPhotoOpenIDView
22from .views import AddOpenIDView, RedirectOpenIDView, ConfirmOpenIDView
23from .views import CropPhotoView
24from .views import UserPreferenceView, UploadLibravatarExportView
25from .views import ResendConfirmationMailView
26from .views import IvatarLoginView
27from .views import DeleteAccountView
28from .views import ExportView
30# Define URL patterns, self documenting
31# To see the fancy, colorful evaluation of these use:
32# ./manager show_urls
33urlpatterns = [ # pylint: disable=invalid-name
34 path("new/", CreateView.as_view(), name="new_account"),
35 path("login/", IvatarLoginView.as_view(), name="login"),
36 path("logout/", LogoutView.as_view(next_page="/"), name="logout"),
37 path(
38 "password_change/",
39 PasswordChangeView.as_view(template_name="password_change.html"),
40 name="password_change",
41 ),
42 path(
43 "password_change/done/",
44 PasswordChangeDoneView.as_view(template_name="password_change_done.html"),
45 name="password_change_done",
46 ),
47 path(
48 "password_reset/",
49 PasswordResetView.as_view(template_name="password_reset.html"),
50 name="password_reset",
51 ),
52 path(
53 "password_reset/done/",
54 PasswordResetDoneView.as_view(template_name="password_reset_submitted.html"),
55 name="password_reset_done",
56 ),
57 path(
58 "reset/<uidb64>/<token>/",
59 PasswordResetConfirmView.as_view(template_name="password_change.html"),
60 name="password_reset_confirm",
61 ),
62 path(
63 "reset/done/",
64 PasswordResetCompleteView.as_view(template_name="password_change_done.html"),
65 name="password_reset_complete",
66 ),
67 path(
68 "export/",
69 ExportView.as_view(),
70 name="export",
71 ),
72 path("delete/", DeleteAccountView.as_view(), name="delete"),
73 path("profile/", ProfileView.as_view(), name="profile"),
74 re_path(
75 "profile/(?P<profile_username>.+)",
76 ProfileView.as_view(),
77 name="profile_with_profile_username",
78 ),
79 path("add_email/", AddEmailView.as_view(), name="add_email"),
80 path("add_openid/", AddOpenIDView.as_view(), name="add_openid"),
81 path("upload_photo/", UploadPhotoView.as_view(), name="upload_photo"),
82 path("password_set/", PasswordSetView.as_view(), name="password_set"),
83 re_path(
84 r"remove_unconfirmed_openid/(?P<openid_id>\d+)",
85 RemoveUnconfirmedOpenIDView.as_view(),
86 name="remove_unconfirmed_openid",
87 ),
88 re_path(
89 r"remove_confirmed_openid/(?P<openid_id>\d+)",
90 RemoveConfirmedOpenIDView.as_view(),
91 name="remove_confirmed_openid",
92 ),
93 re_path(
94 r"openid_redirection/(?P<openid_id>\d+)",
95 RedirectOpenIDView.as_view(),
96 name="openid_redirection",
97 ),
98 re_path(
99 r"confirm_openid/(?P<openid_id>\w+)",
100 ConfirmOpenIDView.as_view(),
101 name="confirm_openid",
102 ),
103 re_path(
104 r"confirm_email/(?P<verification_key>\w+)",
105 ConfirmEmailView.as_view(),
106 name="confirm_email",
107 ),
108 re_path(
109 r"remove_unconfirmed_email/(?P<email_id>\d+)",
110 RemoveUnconfirmedEmailView.as_view(),
111 name="remove_unconfirmed_email",
112 ),
113 re_path(
114 r"remove_confirmed_email/(?P<email_id>\d+)",
115 RemoveConfirmedEmailView.as_view(),
116 name="remove_confirmed_email",
117 ),
118 re_path(
119 r"assign_photo_email/(?P<email_id>\d+)",
120 AssignPhotoEmailView.as_view(),
121 name="assign_photo_email",
122 ),
123 re_path(
124 r"assign_photo_openid/(?P<openid_id>\d+)",
125 AssignPhotoOpenIDView.as_view(),
126 name="assign_photo_openid",
127 ),
128 re_path(r"import_photo/$", ImportPhotoView.as_view(), name="import_photo"),
129 re_path(
130 r"import_photo/(?P<email_addr>[\w.+-]+@[\w.]+.[\w.]+)",
131 ImportPhotoView.as_view(),
132 name="import_photo",
133 ),
134 re_path(
135 r"import_photo/(?P<email_id>\d+)",
136 ImportPhotoView.as_view(),
137 name="import_photo",
138 ),
139 re_path(
140 r"delete_photo/(?P<pk>\d+)", DeletePhotoView.as_view(), name="delete_photo"
141 ),
142 re_path(r"raw_image/(?P<pk>\d+)", RawImageView.as_view(), name="raw_image"),
143 re_path(r"crop_photo/(?P<pk>\d+)", CropPhotoView.as_view(), name="crop_photo"),
144 re_path(r"pref/$", UserPreferenceView.as_view(), name="user_preference"),
145 re_path(
146 r"upload_export/$", UploadLibravatarExportView.as_view(), name="upload_export"
147 ),
148 re_path(
149 r"upload_export/(?P<save>save)$",
150 UploadLibravatarExportView.as_view(),
151 name="upload_export",
152 ),
153 re_path(
154 r"resend_confirmation_mail/(?P<email_id>\d+)",
155 ResendConfirmationMailView.as_view(),
156 name="resend_confirmation_mail",
157 ),
158]