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.

get_queryset()[source]

Filter the queryset with GET[‘q’].

class scipost.views.UserAutocompleteView(**kwargs)[source]

Bases: dal_select2.views.Select2QuerySetView

View to feed the Select2 widget.

get_queryset()[source]

Filter the queryset with GET[‘q’].

get_result_label(item)[source]

Return the label of a result.

scipost.views.trigger_error(request)[source]
scipost.views.portal(request)[source]
scipost.views.portal_hx_home(request)[source]

Homepage view of SciPost.

scipost.views.portal_hx_journals(request)[source]
scipost.views.portal_hx_publications(request)[source]
scipost.views.portal_hx_publications_page(request)[source]
scipost.views.portal_hx_submissions(request)[source]
scipost.views.portal_hx_submissions_page(request)[source]
scipost.views.portal_hx_reports(request)[source]
scipost.views.portal_hx_reports_page(request)[source]
scipost.views.portal_hx_comments(request)[source]
scipost.views.portal_hx_comments_page(request)[source]
scipost.views.portal_hx_commentaries(request)[source]
scipost.views.portal_hx_commentaries_page(request)[source]
scipost.views.portal_hx_theses(request)[source]
scipost.views.portal_hx_theses_page(request)[source]
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.feeds(request)[source]

Information page for RSS and Atom feeds.

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.

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_requests(request)[source]

List of new Registration requests to vet.

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

alias of scipost.forms.SciPostAuthenticationForm

get_initial()[source]

Return the initial data to use for forms on this view.

get_success_url()[source]

Add items to session variables.

get_redirect_url()[source]

Redirect to the requested url if safe, otherwise to personal page or org dashboard.

scipost.views.raw_user_auth_info(request)[source]
class scipost.views.SciPostLogoutView(**kwargs)[source]

Bases: django.contrib.auth.views.LogoutView

Logout processing page.

next_page = '/'
dispatch(request, *args, **kwargs)[source]

Add message to request after logout.

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'
get_success_url()[source]

Add a message confirming the change, then redirect to personal page.

For Contributor users, this ends up on the personal page. For organization Contacts, this ends up on the organizations dashboard.

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'
get_success_url()[source]

Add a message confirming the request for a new token, then redirect to homepage.

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'
get_success_url()[source]

Add a message confirming the reset, then redirect to personal page (for which login will be required).

For Contributor users, this ends up on the personal page. For organization Contacts, this ends up on the organizations dashboard.

scipost.views.mark_unavailable_period(request)[source]

Form view to mark period unavailable for Contributor.

scipost.views.delete_unavailable_period(request, period_id)[source]

Delete period unavailable registered.

scipost.views.personal_page(request)[source]
scipost.views.personal_page_hx_account(request)[source]

Personal Page tab: Account.

scipost.views.personal_page_hx_admin(request)[source]

Personal Page tab: Admin Actions.

scipost.views.personal_page_hx_edadmin(request)[source]

Personal Page tab: Editorial Actions.

scipost.views.personal_page_hx_refereeing(request)[source]
scipost.views.personal_page_hx_publications(request)[source]

Personal Page tab: Publications.

scipost.views.personal_page_hx_submissions(request)[source]

Personal Page tab: Submissions.

scipost.views.personal_page_hx_commentaries(request)[source]

Personal Page tab: Commentaries.

scipost.views.personal_page_hx_theses(request)[source]

Personal Page tab: Theses.

scipost.views.personal_page_hx_comments(request)[source]

Personal Page tab: Comments.

scipost.views.personal_page_hx_author_replies(request)[source]

Personal Page tab: Author Replies.

scipost.views.update_personal_data(request)[source]
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.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

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.'
get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

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/'
get_queryset()[source]

Return the QuerySet that will be used to look up the object.

This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.

scipost.views.claim_authorships(request)[source]

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.claim_sub_authorship(request, submission_id, claim)[source]
scipost.views.claim_com_authorship(request, commentary_id, claim)[source]
scipost.views.claim_thesis_authorship(request, thesis_id, claim)[source]
scipost.views.vet_authorship_claims(request)[source]
scipost.views.vet_authorship_claim(request, claim_id, claim)[source]
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'
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

get_context_data(*args, **kwargs)[source]

Get the context for this view.

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)

scipost.views.send_precooked_email(request)[source]

Method to send precooked emails to individuals (registered or not)

scipost.views.EdCol_bylaws(request)[source]
scipost.views.EdCol_bylaws_Changes_2021_04(request)[source]
scipost.views.csrf_failure(request, reason='')[source]

CSRF Failure page.

scipost.views.have_i_been_pwned(request)[source]