shuup.front.apps.registration package

Submodules

shuup.front.apps.registration.forms module

class shuup.front.apps.registration.forms.UserCreationForm(*args, **kwargs)[source]

Bases: UserCreationForm

class Meta[source]

Bases: Meta

model

alias of User

clean_password2()[source]
base_fields = {'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}
declared_fields = {'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>}
property media

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

class shuup.front.apps.registration.forms.CompanyForm(*args, **kwargs)[source]

Bases: TaxNumberCleanMixin, ModelForm

class Meta[source]

Bases: object

model

alias of CompanyContact

fields = ['name', 'name_ext', 'tax_number', 'email', 'phone', 'www']
help_texts = {'email': None, 'name': 'Name of the company', 'phone': None}
__init__(*args, **kwargs)[source]
base_fields = {'email': <django.forms.fields.EmailField object>, 'name': <django.forms.fields.CharField object>, 'name_ext': <django.forms.fields.CharField object>, 'phone': <django.forms.fields.CharField object>, 'tax_number': <django.forms.fields.CharField object>, 'www': <django.forms.fields.URLField object>}
declared_fields = {}
property media

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

class shuup.front.apps.registration.forms.ContactPersonForm(**kwargs)[source]

Bases: ModelForm

class Meta[source]

Bases: object

model

alias of PersonContact

fields = ['first_name', 'last_name', 'email', 'phone']
__init__(**kwargs)[source]
base_fields = {'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'phone': <django.forms.fields.CharField object>}
declared_fields = {}
property media

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

class shuup.front.apps.registration.forms.PersonRegistrationForm(*args, **kwargs)[source]

Bases: RegistrationForm

__init__(*args, **kwargs)[source]
clean_password1()[source]
save(commit=True, *args, **kwargs)[source]

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

base_fields = {'email': <django.forms.fields.EmailField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}
declared_fields = {'email': <django.forms.fields.EmailField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>}
property media

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

class shuup.front.apps.registration.forms.CompanyRegistrationForm(*args, **kwargs)[source]

Bases: FormGroup

__init__(*args, **kwargs)[source]
instantiate_forms()[source]
full_clean()[source]
save(commit=True)[source]

shuup.front.apps.registration.notify_events module

class shuup.front.apps.registration.notify_events.RegistrationReceived(**variable_values)[source]

Bases: Event

identifier = 'registration_received'
name = 'Registration Received'
bindings = {}
variables = {'activation_url': <shuup.notify.base.Variable object>, 'customer': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'user_is_active': <shuup.notify.base.Variable object>}
class shuup.front.apps.registration.notify_events.AccountReactivation(**variable_values)[source]

Bases: RegistrationReceived

identifier = 'account_reactivation'
name = 'Account Reactivation'
bindings = {}
variables = {'activation_url': <shuup.notify.base.Variable object>, 'customer': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'user_is_active': <shuup.notify.base.Variable object>}
class shuup.front.apps.registration.notify_events.CompanyRegistrationReceived(**variable_values)[source]

Bases: RegistrationReceived

identifier = 'company_registration_received'
name = 'Company Registration Received'
bindings = {}
variables = {'activation_url': <shuup.notify.base.Variable object>, 'customer': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'user_is_active': <shuup.notify.base.Variable object>}
class shuup.front.apps.registration.notify_events.CompanyApproved(**variable_values)[source]

Bases: RegistrationReceived

identifier = 'company_approved_by_admin'
name = 'Company Approved'
bindings = {}
variables = {'activation_url': <shuup.notify.base.Variable object>, 'customer': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'user_is_active': <shuup.notify.base.Variable object>}
class shuup.front.apps.registration.notify_events.AccountActivation(**variable_values)[source]

Bases: RegistrationReceived

identifier = 'account_activation'
name = 'Account Activation'
bindings = {}
variables = {'activation_url': <shuup.notify.base.Variable object>, 'customer': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'user_is_active': <shuup.notify.base.Variable object>}
shuup.front.apps.registration.notify_events.send_activation_notification(user, request, **kwargs)[source]
shuup.front.apps.registration.notify_events.send_user_registered_notification(user, request, **kwargs)[source]
shuup.front.apps.registration.notify_events.send_reactivation_notification(user, request, **kwargs)[source]
shuup.front.apps.registration.notify_events.send_company_activated_first_time_notification(instance, request, **kwargs)[source]

shuup.front.apps.registration.settings module

shuup.front.apps.registration.settings.REGISTRATION_FORM = 'shuup.front.apps.registration.forms.PersonRegistrationForm'

The Shuup default registration form for person This overrides the setting from registration lib to allow custom logic like receiving the request from kwargs

shuup.front.apps.registration.signals module

shuup.front.apps.registration.signals.handle_user_activation(user, **kwargs)[source]
shuup.front.apps.registration.signals.activate_contact_by_user(user, **kwargs)[source]

shuup.front.apps.registration.urls module

shuup.front.apps.registration.views module

shuup.front.apps.registration.views.activation_complete(request)[source]
shuup.front.apps.registration.views.registration_complete(request)[source]
class shuup.front.apps.registration.views.RegistrationViewMixin[source]

Bases: object

template_name = 'shuup/registration/register.jinja'
get_success_url(*args, **kwargs)[source]
get_form_kwargs()[source]
register(form)[source]
class shuup.front.apps.registration.views.RegistrationNoActivationView(**kwargs)[source]

Bases: RegistrationViewMixin, RegistrationView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

class shuup.front.apps.registration.views.RegistrationWithActivationView(**kwargs)[source]

Bases: RegistrationViewMixin, RegistrationView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

SEND_ACTIVATION_EMAIL = False
class shuup.front.apps.registration.views.RegistrationView(**kwargs)[source]

Bases: View

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

dispatch(request, *args, **kwargs)[source]
class shuup.front.apps.registration.views.CompanyRegistrationView(**kwargs)[source]

Bases: RegistrationViewMixin, RegistrationView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/registration/company_register.jinja'
form_class

alias of CompanyRegistrationForm

SEND_ACTIVATION_EMAIL = False
dispatch(request, *args, **kwargs)[source]

Check that user signup is allowed and if user is logged in before even bothering to dispatch or do other processing.

register(form)[source]

Given a username, email address and password, register a new user account, which will initially be inactive.

Along with the new User object, a new registration.models.RegistrationProfile will be created, tied to that User, containing the activation key which will be used for this account.

An email will be sent to the supplied email address; this email should contain an activation link. The email will be rendered using two templates. See the documentation for RegistrationProfile.send_activation_email() for information about these templates and the contexts provided to them.

After the User and RegistrationProfile are created and the activation email is sent, the signal registration.signals.user_registered will be sent, with the new User as the keyword argument user and the class of this backend as the sender.

class shuup.front.apps.registration.views.ActivationView(**kwargs)[source]

Bases: ActivationView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/registration/activation_failed.jinja'
get_success_url(*args, **kwargs)[source]

Module contents

Shuup Registration Add-on

The shuup.front.apps.registration add-on provides simple user registration and email token based activation.

It is based on the django-registration-redux package.

Installation

Add registration and shuup.front.apps.registration into your INSTALLED_APPS (and run migrations, of course).

The application registers its URLs via the front_urls provides mechanism.

URL names

  • shuup:registration_register – the entry point for registration.

class shuup.front.apps.registration.RegistrationAppConfig(*args, **kwargs)[source]

Bases: AppConfig

name = 'shuup.front.apps.registration'
verbose_name = 'Shuup Frontend - User Registration'
label = 'shuup_front_registration'
required_installed_apps = {'registration': 'django-registration-redux is required for user registration and activation'}

Apps that are required to be in INSTALLED_APPS for this app

This may also be a dict of the form {app_name: reason} where the reason will then be listed in the ImproperlyConfigured exception.

provides = {'front_urls': ['shuup.front.apps.registration.urls:urlpatterns'], 'notify_event': ['shuup.front.apps.registration.notify_events:RegistrationReceived', 'shuup.front.apps.registration.notify_events:AccountReactivation', 'shuup.front.apps.registration.notify_events:CompanyRegistrationReceived', 'shuup.front.apps.registration.notify_events:CompanyApproved', 'shuup.front.apps.registration.notify_events:AccountActivation'], 'notify_script_template': ['shuup.front.apps.registration.notify_events:RegistrationReceivedEmailScriptTemplate', 'shuup.front.apps.registration.notify_events:AccountReactivationEmailScriptTemplate', 'shuup.front.apps.registration.notify_events:CompanyRegistrationReceivedEmailScriptTemplate', 'shuup.front.apps.registration.notify_events:CompanyActivatedEmailScriptTemplate', 'shuup.front.apps.registration.notify_events:AccountActivationEmailScriptTemplate']}

See /provides for details about the provides variable.

ready()[source]

Override this method in subclasses to run code when Django starts.