registrations package

Registrations

This document explains how the registrations module behaviour is defined. The behaviour of upgrading an existing ‘year’ membership to a ‘study’ membership (until graduation) are taken from the Rules and Regulations. If the Rules and Regulations ever change this behaviour should be changed to reflect those changes.

This module both provides registration for members and for benefactors. The only difference is the form and view used for their registration since the information we ask from them is different.

New member/benefactor registration

Frontend

  • User enters information
    • If the membership type is ‘benefactor’:

      The amount used in the payment is provided during the registration process by the user.

  • User accepts privacy policy

    This step is obligatory. We do not accept people that do not accept the privacy policy. It’s currently implemented as a checkbox in the forms.

  • System validates info
    • Correct address

    • Valid and unique email address
      • Checked against existing users

    • Privacy policy accepted

    • If the selected membership type is ‘member’:
      • valid and unique student number
        • Checked against existing users

      • selected programme

      • cohort

  • Registration model created (status: Awaiting email confirmation)

  • Email address confirmation sent

  • User confirms email address

  • Registration model status changed (status: Ready for review)

  • If the registration is for a benefactor an email is sent with a link to get references
    • Existing members of Thalia add references using the link

Backend

  1. Admin accepts registration
    • System checks if username is unique
      • If it’s not unique a username can be entered manually

      • If it’s still not unique the registration cannot be accepted

      • If it’s unique the generated username will be added to the registration

    • Payment model is created (unprocessed at first)
      • If the membership type is ‘member’:
        • Amount is calculated based on the selected length (‘study’ or ‘year’)
          • Values are located in thaliawebsite.settings

      • If the membership type is ‘benefactor’:
        • Amount is determined by the value entered during registration

      • Email is sent as acceptance confirmation containg instructions for Payment processing

  2. Admin rejects registration
    • Email is sent as rejection message

Existing user membership renewal

Frontend

  • User enters information (length, type)
    • If latest membership has not ended yet: always allow ‘study’ length

    • If latest membership has ended or ends within 1 month: also allow ‘year’ length

    • If latest membership is ‘study’ and did not end: do not allow renewal

  • Renewal model created (status: Ready for review)

  • If the renewal is for a benefactor an email is sent with a link to get references
    • Existing members of Thalia add references using the link

Backend

  1. Admin accepts renewal
    • Payment model is created (processed: False)
      • Amount is calculated based on selected length (‘study’ or ‘year’)
        • Values are located in thaliawebsite.settings

        • If the current membership has not ended yet and an until date is present for that membership and

        the selected length is ‘study’ the amount will be price[‘study’] - price[‘year’]

      • Email is sent as acceptance confirmation containg instructions for Payment processing

  2. Admin rejects renewal
    • Email is sent as rejection message

Payment processing

Backend

  • Admin (or the system, if automated using e.g. iDeal) processes payment
    • If this is a Registration model then User and Member models are created

    • If this is a Renewal model then the Member is retrieved

    • A membership is added to the provided Member model based on the provided length
      • If the latest (not current, since there may have been some time between asking for the upgrade and accepting it) membership has an until date and

        the selected length is ‘study’ that membership will be updated to have None as until date. No new membership will be created.

      • During a lecture year the until date will be the 31 August of the lecture year + 1. Thus is you process payments in November 2016 that means the memberships will end on 31 August 2017

      • For payments processed in August the lecture year will be increased by 1. So if you process payments in August 2017 that means the memberships will end on 31 August 2018.

    • Payment confirmation sent (if this is a Renewal model)

Submodules

registrations.admin module

Registers admin interfaces for the registrations module

class registrations.admin.ReferenceInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.StackedInline

extra = 0
property media
model

alias of registrations.models.Reference

class registrations.admin.RegistrationAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

Manage the registrations

accept_selected(request, queryset)[source]

Accept the selected entries

actions = ['accept_selected', 'reject_selected']
changeform_view(request, object_id=None, form_url='', extra_context=None)[source]

Renders the change formview Only allow when the entry has not been processed yet

date_hierarchy = 'created_at'
fieldsets = (('Application information', {'fields': ('created_at', 'updated_at', 'username', 'length', 'contribution', 'membership_type', 'status', 'payment', 'remarks')}), ('Personal information', {'fields': ('first_name', 'last_name', 'birthday', 'optin_birthday', 'email', 'optin_mailinglist', 'phone_number')}), ('Address', {'fields': ('address_street', 'address_street2', 'address_postal_code', 'address_city', 'address_country')}), ('University information', {'fields': ('student_number', 'programme', 'starting_year')}))
formfield_for_dbfield(db_field, request, **kwargs)[source]

Hook for specifying the form Field instance for a given database Field instance.

If kwargs are given, they’re passed to the form Field’s constructor.

get_readonly_fields(request, obj=None)[source]

Hook for specifying custom readonly fields.

has_review_permission(request)[source]

Does the user have the review permission?

inlines = (<class 'registrations.admin.ReferenceInline'>,)
list_display = ('name', 'email', 'status', 'membership_type', 'created_at', 'payment_status', 'no_references', 'reference_count')
list_filter = ('status', 'programme', 'membership_type', 'no_references', 'payment__type', 'payment__amount')
property media
static name(obj)[source]
static payment_status(obj)[source]
reference_count(obj)[source]
reject_selected(request, queryset)[source]

Reject the selected entries

save_model(request, obj, form, change)[source]

Given a model instance save it to the database.

search_fields = ('first_name', 'last_name', 'email', 'phone_number', 'student_number')
class registrations.admin.RenewalAdmin(model, admin_site)[source]

Bases: registrations.admin.RegistrationAdmin

Manage the renewals

actions = ['accept_selected', 'reject_selected']
date_hierarchy = 'created_at'
static email(obj)[source]
fieldsets = (('Application information', {'fields': ('created_at', 'updated_at', 'length', 'contribution', 'membership_type', 'status', 'payment', 'remarks', 'member')}),)
get_readonly_fields(request, obj=None)[source]

Make all fields read-only and add member if needed

list_display = ('name', 'email', 'status', 'membership_type', 'created_at', 'payment_status', 'no_references', 'reference_count')
list_filter = ('status', 'membership_type', 'no_references', 'payment__type', 'payment__amount')
property media
static name(obj)[source]
search_fields = ('member__first_name', 'member__last_name', 'member__email', 'member__profile__phone_number', 'member__profile__student_number')

registrations.apps module

Configuration for the newsletters package

class registrations.apps.RegistrationsConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

AppConfig for the registrations package

name = 'registrations'
ready()[source]

Imports the signals when the app is ready

verbose_name = 'Registrations'

registrations.emails module

The emails defined by the registrations package

registrations.emails.send_new_registration_board_message(registration: registrations.models.Registration)None[source]

Send a notification to the board about a new registration

Parameters

registration – the registration entry

registrations.emails.send_new_renewal_board_message(renewal: registrations.models.Renewal)None[source]

Send a notification to the board about a new renewal

Parameters

renewal – the renewal entry

registrations.emails.send_references_information_message(entry: Union[registrations.models.Registration, registrations.models.Renewal])None[source]

Send a notification to the user with information about references These are required for benefactors who have not been a Thalia member and do not work for iCIS

Parameters

entry – the registration or renewal entry

registrations.emails.send_registration_accepted_message(registration: registrations.models.Registration, payment: payments.models.Payment)None[source]

Send the registration acceptance email

Parameters
  • registration – the registration entry

  • payment – the payment entry

registrations.emails.send_registration_email_confirmation(registration: registrations.models.Registration)None[source]

Send the email confirmation message

Parameters

registration – the registration entry

registrations.emails.send_registration_rejected_message(registration: registrations.models.Registration)None[source]

Send the registration rejection email

Parameters

registration – the registration entry

registrations.emails.send_renewal_accepted_message(renewal: registrations.models.Renewal, payment: payments.models.Payment)None[source]

Send the renewal acceptation email

Parameters
  • renewal – the renewal entry

  • payment – the payment entry

registrations.emails.send_renewal_complete_message(renewal: registrations.models.Renewal)None[source]

Send the email completing the renewal

Parameters

renewal – the renewal entry

registrations.emails.send_renewal_rejected_message(renewal: registrations.models.Renewal)None[source]

Send the renewal rejection email

Parameters

renewal – the renewal entry

registrations.forms module

The forms defined by the registrations package

class registrations.forms.BaseRegistrationForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

Base form for membership registrations

base_fields = {'birthday': <django.forms.fields.DateField object>, 'privacy_policy': <django.forms.fields.BooleanField object>}
declared_fields = {'birthday': <django.forms.fields.DateField object>, 'privacy_policy': <django.forms.fields.BooleanField object>}
property media

Return all media required to render the widgets on this form.

class registrations.forms.BenefactorRegistrationForm(*args, **kwargs)[source]

Bases: registrations.forms.BaseRegistrationForm

Form for benefactor registrations

class Meta[source]

Bases: object

exclude = ['created_at', 'updated_at', 'status', 'username', 'starting_year', 'programme', 'payment', 'membership']
fields = '__all__'
model

alias of registrations.models.Registration

base_fields = {'address_city': <django.forms.fields.CharField object>, 'address_country': <django.forms.fields.TypedChoiceField object>, 'address_postal_code': <django.forms.fields.CharField object>, 'address_street': <django.forms.fields.CharField object>, 'address_street2': <django.forms.fields.CharField object>, 'birthday': <django.forms.fields.DateField object>, 'contribution': <django.forms.fields.FloatField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'icis_employee': <django.forms.fields.BooleanField object>, 'language': <django.forms.fields.TypedChoiceField object>, 'last_name': <django.forms.fields.CharField object>, 'length': <django.forms.fields.TypedChoiceField object>, 'membership_type': <django.forms.fields.TypedChoiceField object>, 'no_references': <django.forms.fields.BooleanField object>, 'optin_birthday': <django.forms.fields.BooleanField object>, 'optin_mailinglist': <django.forms.fields.BooleanField object>, 'phone_number': <django.forms.fields.CharField object>, 'privacy_policy': <django.forms.fields.BooleanField object>, 'remarks': <django.forms.fields.CharField object>, 'student_number': <django.forms.fields.CharField object>}
declared_fields = {'birthday': <django.forms.fields.DateField object>, 'icis_employee': <django.forms.fields.BooleanField object>, 'privacy_policy': <django.forms.fields.BooleanField object>}
property media

Return all media required to render the widgets on this form.

class registrations.forms.MemberRegistrationForm(*args, **kwargs)[source]

Bases: registrations.forms.BaseRegistrationForm

Form for member registrations

class Meta[source]

Bases: object

exclude = ['created_at', 'updated_at', 'status', 'username', 'payment', 'membership']
fields = '__all__'
model

alias of registrations.models.Registration

base_fields = {'address_city': <django.forms.fields.CharField object>, 'address_country': <django.forms.fields.TypedChoiceField object>, 'address_postal_code': <django.forms.fields.CharField object>, 'address_street': <django.forms.fields.CharField object>, 'address_street2': <django.forms.fields.CharField object>, 'birthday': <django.forms.fields.DateField object>, 'contribution': <django.forms.fields.FloatField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'language': <django.forms.fields.TypedChoiceField object>, 'last_name': <django.forms.fields.CharField object>, 'length': <django.forms.fields.TypedChoiceField object>, 'membership_type': <django.forms.fields.TypedChoiceField object>, 'no_references': <django.forms.fields.BooleanField object>, 'optin_birthday': <django.forms.fields.BooleanField object>, 'optin_mailinglist': <django.forms.fields.BooleanField object>, 'phone_number': <django.forms.fields.CharField object>, 'privacy_policy': <django.forms.fields.BooleanField object>, 'programme': <django.forms.fields.TypedChoiceField object>, 'remarks': <django.forms.fields.CharField object>, 'starting_year': <django.forms.fields.TypedChoiceField object>, 'student_number': <django.forms.fields.CharField object>}
declared_fields = {'birthday': <django.forms.fields.DateField object>, 'privacy_policy': <django.forms.fields.BooleanField object>, 'starting_year': <django.forms.fields.TypedChoiceField object>}
property media

Return all media required to render the widgets on this form.

this_year = 2020
years = <list_reverseiterator object>
class registrations.forms.ReferenceForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

error_messages = {'__all__': {'unique_together': "You've already given a reference for this person."}}
fields = '__all__'
model

alias of registrations.models.Reference

base_fields = {'entry': <django.forms.models.ModelChoiceField object>, 'member': <django.forms.models.ModelChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {}
property media

Return all media required to render the widgets on this form.

class registrations.forms.RenewalForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

Form for membership renewals

class Meta[source]

Bases: object

exclude = ['created_at', 'updated_at', 'status', 'payment', 'membership']
fields = '__all__'
model

alias of registrations.models.Renewal

base_fields = {'contribution': <django.forms.fields.FloatField object>, 'icis_employee': <django.forms.fields.BooleanField object>, 'length': <django.forms.fields.TypedChoiceField object>, 'member': <django.forms.models.ModelChoiceField object>, 'membership_type': <django.forms.fields.TypedChoiceField object>, 'no_references': <django.forms.fields.BooleanField object>, 'privacy_policy': <django.forms.fields.BooleanField object>, 'remarks': <django.forms.fields.CharField object>}
declared_fields = {'icis_employee': <django.forms.fields.BooleanField object>, 'privacy_policy': <django.forms.fields.BooleanField object>}
property media

Return all media required to render the widgets on this form.

registrations.models module

The models defined by the registrations package

class registrations.models.Entry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Describes a registration entry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

MEMBERSHIP_LENGTHS = (('year', 'One year -- €7.50'), ('study', 'Until graduation -- €30.00'))
MEMBERSHIP_STUDY = 'study'
MEMBERSHIP_TYPES = [('member', 'Member'), ('benefactor', 'Benefactor')]
MEMBERSHIP_YEAR = 'year'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

STATUS_ACCEPTED = 'accepted'
STATUS_COMPLETED = 'completed'
STATUS_CONFIRM = 'confirm'
STATUS_REJECTED = 'rejected'
STATUS_REVIEW = 'review'
STATUS_TYPE = (('confirm', 'Awaiting email confirmation'), ('review', 'Ready for review'), ('rejected', 'Rejected'), ('accepted', 'Accepted'), ('completed', 'Completed'))
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

contribution

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_length_display(*, field=<django.db.models.fields.CharField: length>)
get_membership_type_display(*, field=<django.db.models.fields.CharField: membership_type>)
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

length

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

membership

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

membership_id
membership_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

no_references

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
payment

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

payment_id
reference_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

registration

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

remarks

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

renewal

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

save(force_insert=False, force_update=False, using=None, update_fields=None)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class registrations.models.Reference(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Describes a reference of a member for a potential member

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

entry

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

entry_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

member

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

member_id
objects = <django.db.models.manager.Manager object>
class registrations.models.Registration(*args, **kwargs)[source]

Bases: registrations.models.Entry

Describes a new registration for the association

exception DoesNotExist

Bases: registrations.models.Entry.DoesNotExist

exception MultipleObjectsReturned

Bases: registrations.models.Entry.MultipleObjectsReturned

address_city

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

address_country

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

address_postal_code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

address_street

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

address_street2

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

birthday

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

entry_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

entry_ptr_id
first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_address_country_display(*, field=<django.db.models.fields.CharField: address_country>)
get_full_name()[source]
get_language_display(*, field=<django.db.models.fields.CharField: language>)
get_next_by_birthday(*, field=<django.db.models.fields.DateField: birthday>, is_next=True, **kwargs)
get_previous_by_birthday(*, field=<django.db.models.fields.DateField: birthday>, is_next=False, **kwargs)
get_programme_display(*, field=<django.db.models.fields.CharField: programme>)
language

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

optin_birthday

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

optin_mailinglist

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

phone_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

programme

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

starting_year

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

student_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

username

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class registrations.models.Renewal(*args, **kwargs)[source]

Bases: registrations.models.Entry

Describes a renewal for the association membership

exception DoesNotExist

Bases: registrations.models.Entry.DoesNotExist

exception MultipleObjectsReturned

Bases: registrations.models.Entry.MultipleObjectsReturned

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

entry_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

entry_ptr_id
member

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

member_id
save(force_insert=False, force_update=False, using=None, update_fields=None)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

registrations.services module

The services defined by the registrations package

registrations.services.accept_entries(user_id: int, queryset: django.db.models.query.QuerySet)int[source]

Accept all entries in the queryset

Parameters
  • user_id – Id of the user executing this action

  • queryset (Queryset[Entry]) – queryset of entries

Returns

number of updated rows

Return type

integer

registrations.services.calculate_membership_since()datetime.datetime[source]

Calculate the start date of a membership

If it’s August we act as if it’s the next lecture year already and we start new memberships in September :return:

registrations.services.check_unique_user(entry: registrations.models.Entry)bool[source]

Check that the username and email address of the entry are unique.

Parameters

entry (Entry) – Registration entry

Returns

True if unique, False if not unique

Return type

boolean

registrations.services.confirm_entry(queryset: django.db.models.query.QuerySet)int[source]

Confirm all entries in the queryset

Parameters

queryset (Queryset[Entry]) – queryset of entries

Returns

number of updated rows

Return type

integer

registrations.services.execute_data_minimisation(dry_run=False)[source]

Delete completed or rejected registrations that were modified at least 31 days ago

Parameters

dry_run – does not really remove data if True

Returns

number of removed registrations

registrations.services.process_payment(payment: payments.models.Payment)None[source]

Process the payment for the entry and send the right emails

Parameters

payment (Payment) – The payment that should be processed

registrations.services.reject_entries(user_id: int, queryset: django.db.models.query.QuerySet)int[source]

Reject all entries in the queryset

Parameters
  • user_id – Id of the user executing this action

  • queryset (Queryset[Entry]) – queryset of entries

Returns

number of updated rows

Return type

integer

registrations.services.revert_entry(user_id: int, entry: registrations.models.Entry)None[source]

Revert status of entry to review so that it can be corrected

Parameters
  • user_id – Id of the user executing this action

  • entry – Entry that should be reverted

registrations.signals module

The signals checked by the registrations package

registrations.signals.post_payment_save(sender, instance, **kwargs)[source]

Process a payment when it is saved

registrations.urls module

The routes defined by the registrations package

registrations.views module

Views provided by the registrations package

class registrations.views.BaseRegistrationFormView(**kwargs)[source]

Bases: django.views.generic.edit.FormView

View that renders a membership registration form

form_class

alias of registrations.forms.MemberRegistrationForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get(request, *args, **kwargs)[source]

Handle GET requests: instantiate a blank version of the form.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

template_name = 'registrations/register_member.html'
class registrations.views.BecomeAMemberView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

View that render a HTML template with context data

get_context_data(**kwargs)[source]
template_name = 'registrations/become_a_member.html'
class registrations.views.BenefactorRegistrationFormView(**kwargs)[source]

Bases: registrations.views.BaseRegistrationFormView

View that renders the benefactor membership registration form

form_class

alias of registrations.forms.BenefactorRegistrationForm

post(request, *args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

template_name = 'registrations/register_benefactor.html'
class registrations.views.ConfirmEmailView(**kwargs)[source]

Bases: django.views.generic.base.View, django.views.generic.base.TemplateResponseMixin

View that renders an HTML template and confirms the email address of the provided registration

get(request, *args, **kwargs)[source]
template_name = 'registrations/confirm_email.html'
class registrations.views.EntryAdminView(**kwargs)[source]

Bases: django.views.generic.base.View

View that handles the processing of entries

dispatch(request, *args, **kwargs)
post(request, *args, **kwargs)[source]
class registrations.views.MemberRegistrationFormView(**kwargs)[source]

Bases: registrations.views.BaseRegistrationFormView

View that renders the member membership registration form

form_class

alias of registrations.forms.MemberRegistrationForm

post(request, *args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

template_name = 'registrations/register_member.html'
class registrations.views.ReferenceCreateView(**kwargs)[source]

Bases: django.views.generic.edit.CreateView

View that renders a reference creation form

dispatch(request, *args, **kwargs)[source]
entry = None
form_class

alias of registrations.forms.ReferenceForm

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of registrations.models.Reference

post(request, *args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

success = False
template_name = 'registrations/reference.html'
class registrations.views.RenewalFormView(**kwargs)[source]

Bases: django.views.generic.edit.FormView

View that renders the membership renewal form

dispatch(request, *args, **kwargs)
form_class

alias of registrations.forms.RenewalForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form(form_class=None)[source]

Return an instance of the form to be used in this view.

post(request, *args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

template_name = 'registrations/renewal.html'