- Move Oscar app configs into Django app config classes
- Rename Oscar/Django apps' app config module
- Remove "oscar.get_core_apps()" and its app overriding
- Remove "oscar.OSCAR_CORE_APPS"
- Port app forking code to work with Django app registry
- Port class loading code to use app configs to get app properties
Fix URL character validation in dashboard PageUpdateForm.
Also fix the max_length on the url field. The underlying model field has
a max_length of 100, so it is invalid to have a larger value here.
DRY out dashboard page update/create views.
Refactor tests - perform tests of form logic directly rather than indirectly through view code.
Fixes #2559.
Replace assert statements with appropriate assert* method.
Replace 'assert' with 'assert*' method.
Convert tests.unit.forms.widget_tests to use TestCase class.
Convert bankcard tests to use TestCase.
Convert tests.unit.logging_tests to use TestCase.
As category slugs are relevant for SEO, it is often desirable to be able
to change them independently of the name.
Previously, Oscar by default updated the slug on each save().
This commit completely removes the logic to update an existing slug, as
it is an anti-pattern, as it breaks old links to the site.
It also doesn't raise a ValidationError in the save() method any more,
which is an anti pattern as well. Unfortunately, we can't validate
uniqueness in a clean_slug method (where it should live) as we need
treebeard's information about siblings, which is only available after
save.
This commit replaces the previous slug handling by a simpler approach:
if no slug is supplied, we generate one -- otherwise we assume the user
knows what they're doing.
06c2441 changed the way actions are submitted for on the dashboard's
order list view. This commit updates the test to match the new
behaviour.
I'd also argue that the two test methods test different aspects of the
same thing, so I merged them, which saves us one (relatively slow) test
run.
Parent/child products aren't supported in permission-based dashboard
Currently, a product's stockrecords are used to decide if a user is
allowed to edit a product or not. That doesn't work for parent products,
because they don't have stockrecords. So it's not possible to decide
whether a user is allowed to edit a parent product (and e.g. create
children) for it.
As far as I'm aware, this is not a regression of the
permission-dashboard; I don't think it ever worked. It just hasn't been
spotted because nobody needed it.
This commit also adds some tests to ensure this is enforced.
The ProductCreateUpdateView had untested logic to handle invalid parent
products. Unfortunately, it didn't work; the check returned a redirect,
which later was tried to access like a product.
The only place to issue a redirect for invalid products is the dispatch
method, so an altered check has been moved there.
This time with tests...
It was broken without anyone noticing, as reported in #1451. My work in
PR #1441 magically fixed it, but we should still test it.
Fixes #1451.
Also sneakily fixes the wrong URL in the release notes for the previous
commit.