The customer app bundles communication with customers. This includes models to record product alerts and sent emails. It also contains the views that allow a customer to manage their data (profile information, shipping addresses, etc.)

Abstract models

class oscar.apps.customer.abstract_models.AbstractCommunicationEventType(*args, **kwargs)[source]

A ‘type’ of communication. Like an order confirmation email.


Code used for looking up this event programmatically.


Return a dict of templates with the context merged in

We look first at the field templates but fail over to a set of file templates that follow a conventional path.


Name is the friendly description of an event for use in the admin

class oscar.apps.customer.abstract_models.AbstractEmail(*args, **kwargs)[source]

This is a record of all emails sent to a customer. Normally, we only record order-related emails.

class oscar.apps.customer.abstract_models.AbstractProductAlert(*args, **kwargs)[source]

An alert for when a product comes back in stock


Get a random generated key based on SHA-1 and email address

class oscar.apps.customer.abstract_models.AbstractUser(*args, **kwargs)[source]

An abstract base user suitable for use in Oscar projects.

This is basically a copy of the core AbstractUser model but without a username field


class oscar.apps.customer.forms.ConfirmPasswordForm(user, *args, **kwargs)[source]

Extends the standard django AuthenticationForm, to support 75 character usernames. 75 character usernames are needed to support the EmailOrUsername auth backend.

class oscar.apps.customer.forms.EmailAuthenticationForm(host, *args, **kwargs)[source]

Extends the standard django AuthenticationForm, to support 75 character usernames. 75 character usernames are needed to support the EmailOrUsername auth backend.

class oscar.apps.customer.forms.PasswordResetForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

This form takes the same structure as its parent from django.contrib.auth

save(domain_override=None, use_https=False, request=None, **kwargs)[source]

Generates a one-use only link for resetting password and sends to the user.


class oscar.apps.customer.views.AccountAuthView(**kwargs)[source]

This is actually a slightly odd double form view that allows a customer to either login or register.


alias of EmailAuthenticationForm

class oscar.apps.customer.views.AccountSummaryView(**kwargs)[source]

View that exists for legacy reasons and customisability. It commonly gets called when the user clicks on “Account” in the navbar.

Oscar defaults to just redirecting to the profile summary page (and that redirect can be configured via OSCAR_ACCOUNT_REDIRECT_URL), but it’s also likely you want to display an ‘account overview’ page or such like. The presence of this view allows just that, without having to change a lot of templates.

class oscar.apps.customer.views.AddressChangeStatusView(**kwargs)[source]

Sets an address as default_for_(billing|shipping)

class oscar.apps.customer.views.AddressListView(**kwargs)[source]

Customer address book


Return customer’s addresses

class oscar.apps.customer.views.EmailDetailView(**kwargs)[source]

Customer email


Append email subject to page title

class oscar.apps.customer.views.OrderHistoryView(**kwargs)[source]

Customer order history


alias of Order

class oscar.apps.customer.views.OrderLineView(**kwargs)[source]

Customer order line


The alerts module provides functionality that allows customers to sign up for email alerts when out-of-stock products come back in stock. A form for signing up is displayed on product detail pages when a product is not in stock.

If the OSCAR_EAGER_ALERTS` setting is ``True, then alerts are sent as soon as affected stock records are updated. Alternatively, the management command oscar_send_alerts can be used to send alerts periodically.

The context for the alert email body contains a hurry variable that is set to True if the number of active alerts for a product is greater than the quantity of the product available in stock.

Alerts are sent using the Communication Event framework.