Make access check function for dashboard easier to customise
* It can now be specified in OSCAR_DASHBOARD_DEFAULT_ACCESS_FUNCTION
* nav.py and menu.py were split up so that Node can be dynamically
loaded and hence overridden
I recently needed to alter the access function and realised it's not as
easy as I thought.
Ensure "active" offers exclude those that are suspended
This required extending the offer factories to support setting the
start- and end-dates (looking forward to using FactoryBoy now). Some
additional tests were added for the active manager.
Fixes #1128
Remove Product.status field and Contributor models
The Contributor models (Contributor, ContributorRole, ProductContributor
and their abstract versions) were unused and too specific to the book
domain.
Product.status was provided as a convenience, but the real world showed
that more often than not, a different field type is necessary. As adding
a field is much easier than changing the field type, it is removed.
I tried to be conservative and mostly converted SlugFields that have
unique=True set.
For PaymentEventType and CommunicationEventType, it was discovered
that setting unique=True was likely forgotten.
As far as I could tell, no forms needed to be changed as they all
exclude the affected slug fields anyway.
The BooleanField is not used in Oscar core, and not commonly required.
The through-model ProductCategory is empty apart from the two
ForeignKeys, but left in place to allow customising.
It looks like 0.6 was missing some translation files due to a bug in the
Transifex client which was tricked by local timestamps and skipping some
translation files:
https://github.com/transifex/transifex-client/issues/22
We need to remember to use `tx pull -af` next time to force the download
of .po files.
Ticket #1127 correctly mentioned that we can't use Django's
get_user_model to register signals:
https://docs.djangoproject.com/en/1.6/topics/auth/customizing/#custom-users-and-signals
This commit rewrites the affected migrate_alerts_to_user receiver to
just happen in Oscar's AbstractUser save() method. This works upwards of
Django 1.4. For Django 1.4, a receiver must be manually registered to
the correct User model.
Introduce text and HTML representations for product attribute values
Oscar previously did neither do anything special for e.g. image
attributes or richtext attributes, nor provide hooks for doing so.
value_as_text and value_as_html properties have been introduced which
allow customising the output. Whereas the handling of the different
types is still lacking (e.g. the image type definitely needs special
handling), it is much easier to add support for that now. Adding them
has been pushed to a later date and is tracked in #1152.
Fixes #1149.
Change type and name of basket field on AbstractOrder
It used to be a PositiveIntegerField containing the primary key of the
basket. This was a minor design deficiency; a nullable ForeignKey field
seems like the correct way to model that relation.
It's also been renamed from basket_id to basket to reflect the change.
Migrations unfortunately are non-trivial:
* 0019 adds the new ForeignKey field, but called basket_alt
* 0020 migrates data from the old field to the new field
* 0021 drops the now unnecessary field basket_id
* 0022 renames the basket_alt field to basket
The additional step with naming it basket_alt is necessary because of a
column name conflict. Django will pick a column name of 'basket_id' for
a ForeignKey field named 'basket', which is the same column name the
old PositiveIntegerField had.
Fixes #912
This is to enable some coarse metrics of who is using Oscar. We just
look at the referer header to get a rough idea of which sites are using
Oscar.
This is an important measure for Tangent, Oscar's sponsor. It's
documented in the release notes and we'll make sure everyone knows when
Oscar is released. It's easy to opt out of.
Fixes #656
Remove unused AbstractProductImage properties for thumbnailing
Images are resized on the template level with Sorl, so having
those properties only leads to confusion. They were not used by stock
Oscar. Furthermore, thumbnail_url returned the full-size image URL,
which is wrong.
Fixes #1011