scipost.views module¶
-
scipost.views.
sitemap_xml
(request)[source]¶ Dynamically generate a sitemap (xml) for search engines.
-
class
scipost.views.
GroupAutocompleteView
(**kwargs)[source]¶ Bases:
dal_select2.views.Select2QuerySetView
View to feed the Select2 widget.
-
class
scipost.views.
UserAutocompleteView
(**kwargs)[source]¶ Bases:
dal_select2.views.Select2QuerySetView
View to feed the Select2 widget.
-
scipost.views.
protected_serve
(request, path, show_indexes=False)[source]¶ Serve media files from outside the public MEDIA_ROOT folder.
Serve files that are saved outside the default MEDIA_ROOT folder for superusers only! This will be useful eg. in the admin pages.
-
scipost.views.
register
(request)[source]¶ Contributor registration form page.
This public registration view shows and processes the form that will create new user account requests. After registration the Contributor will need to activate their account via the mail sent. After activation the user needs to be vetted by the SciPost admin.
-
scipost.views.
invitation
(request, key)[source]¶ Registration Invitation reception page.
If a scientist has recieved an invitation (RegistrationInvitation) they will the registration via this view which will prefill the default registration form from the invitation data.
-
scipost.views.
activation
(request, contributor_id, key)[source]¶ After registration, an email verification link is sent. Once clicked, the account is activated.
-
scipost.views.
request_new_activation_link
(request, contributor_id, key)[source]¶ Once a user tries to activate their account using the email verification link sent and the key has expired, the user is redirected here to request a new token.
-
scipost.views.
unsubscribe
(request, contributor_id, key)[source]¶ The link to this method is included in all email communications with a Contributor. The key used is the original activation key. At this link, the Contributor can confirm that they does not want to receive any non-essential email notifications from SciPost.
-
scipost.views.
vet_registration_request_ack
(request, contributor_id)[source]¶ Form view to vet new Registration requests.
-
scipost.views.
registration_requests
(request)[source]¶ List all inactive users. These are users that have filled the registration form, but did not yet activate their account using the validation email.
-
scipost.views.
registration_requests_reset
(request, contributor_id)[source]¶ Reset specific activation_key for Contributor and resend activation mail.
-
class
scipost.views.
SciPostLoginView
(**kwargs)[source]¶ Bases:
django.contrib.auth.views.LoginView
Login for all types of users.
Inherits from django.contrib.auth.views:LoginView.
Overriden fields:
template_name
authentication_form
Overriden methods:
get initial: allow prefilling with GET data, for ‘next’
get redirect url
-
template_name
= 'scipost/login.html'¶
-
authentication_form
¶
-
class
scipost.views.
SciPostLogoutView
(**kwargs)[source]¶ Bases:
django.contrib.auth.views.LogoutView
Logout processing page.
-
next_page
= '/'¶
-
-
class
scipost.views.
SciPostPasswordChangeView
(**kwargs)[source]¶ Bases:
django.contrib.auth.views.PasswordChangeView
Change a user’s password (for Contributors and other forms of users).
Inherits from django.contrib.auth.views:PasswordChangeView.
Overriden fields:
template_name
Overriden methods:
get_success_url
-
template_name
= 'scipost/password_change.html'¶
-
class
scipost.views.
SciPostPasswordResetView
(**kwargs)[source]¶ Bases:
django.contrib.auth.views.PasswordResetView
Reset a user’s password.
Derived from django.contrib.auth.views:PasswordResetView.
Overriden fields:
template_name
email_template_name
subject_template_name
Overriden methods:
get_success_url
-
template_name
= 'scipost/password_reset.html'¶
-
email_template_name
= 'scipost/password_reset_email.html'¶
-
subject_template_name
= 'scipost/password_reset_subject.txt'¶
-
class
scipost.views.
SciPostPasswordResetConfirmView
(**kwargs)[source]¶ Bases:
django.contrib.auth.views.PasswordResetConfirmView
Confirm reset of password, for all users.
Derived from django.contrib.auth.views:PasswordResetConfirmView.
Overriden fields:
template_name
Overriden methods:
get_success_url
-
template_name
= 'scipost/password_reset_confirm.html'¶
Form view to mark period unavailable for Contributor.
Delete period unavailable registered.
Personal Page tab: Author Replies.
-
class
scipost.views.
TOTPListView
(**kwargs)[source]¶ Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,django.views.generic.list.ListView
List all TOTP devices for logged in User.
-
class
scipost.views.
TOTPDeviceCreateView
(**kwargs)[source]¶ Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,django.contrib.messages.views.SuccessMessageMixin
,django.views.generic.edit.CreateView
Create a new TOTP device.
-
form_class
¶ alias of
scipost.forms.TOTPDeviceForm
-
template_name
= 'scipost/totpdevice_form.html'¶
-
success_url
= '/totp/'¶
-
success_message
= 'Two factor authentication device %(name)s successfully added.'¶
-
-
class
scipost.views.
TOTPDeviceDeleteView
(**kwargs)[source]¶ Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,django.views.generic.edit.DeleteView
Confirm deletion of a TOTP device.
-
pk_url_kwarg
= 'device_id'¶
-
success_url
= '/totp/'¶
-
The system auto-detects potential authorships (of submissions, papers subject to commentaries, theses, …). The contributor must confirm/deny authorship from the Personal Page.
-
scipost.views.
contributor_info
(request, contributor_id)[source]¶ All visitors can see a digest of a Contributor’s activities/contributions by clicking on the relevant name (in listing headers of Submissions, …).
-
class
scipost.views.
ContributorDuplicateListView
(**kwargs)[source]¶ Bases:
scipost.mixins.PermissionsMixin
,scipost.mixins.PaginationMixin
,django.views.generic.list.ListView
List Contributors with potential (not yet handled) duplicates. Two sources of duplicates are separately considered:
duplicate full names (last name + first name)
duplicate email addresses.
-
permission_required
= 'scipost.can_vet_registration_requests'¶
-
model
¶ alias of
scipost.models.Contributor
-
template_name
= 'scipost/contributor_duplicate_list.html'¶
-
scipost.views.
contributor_merge
(request)[source]¶ Handles the merging of data from one Contributor instance to another, to solve one person - multiple registrations issues.
Both instances are preserved, but the merge_from instance’s status is set to DOUBLE_ACCOUNT and its User is set to inactive.
If both Contributor instances were active, then the account owner is emailed with information about the merge.
-
scipost.views.
email_group_members
(request)[source]¶ Method to send bulk emails to (members of) selected groups
-
scipost.views.
email_particular
(request)[source]¶ Method to send emails to individuals (registered or not)