Get currency default value to play nice with Django 1.7 migrations
When running oscar on Django 1.7 in an application where you have
modified OSCAR_DEFAULT_CURRENCY the new migration engine detects the
change as something it needs to generate a migration for.
Changed the default value to be a function instead. This prevents the
migration engine from interpreting a settings change as something it
needs to generate a migration for.
Closes #1512.
We have differing logic on how to check the referrer for safety, which
should be bundled in one place. Plus it's annoying to have to remember
the typo in REFERER.
@aaugustin helpfully pointed us towards is_safe_url(), so that's the
best thing to use anyway.
Fixes #1221.
We only needed it because Django 1.4 shipped with a pretty old version
of six. Support for that has been removed, and Django 1.5 ships with six
1.6.1, which is more current than we required.
This nicely avoids an issue with django-extra-views pinning a six
version which caused the sandbox build to fail:
https://travis-ci.org/tangentlabs/django-oscar/jobs/32223978#L971
OSCAR_SLUG_FUNCTION: Support string notation to set slugifier
Importing things in settings is discouraged. But until now,
OSCAR_SLUG_FUNCTION could only be set as a callable, which requires
importing. It's now been updated to use the import_string function.
Ensure Oscar always displays timezone-aware datetimes
In a few cases, django.templatefilters.date was used to format a
datetime as string. This filters expects localtime, but was always
passed time in UTC.
Introduced a helper function that should be used instead of the template
filter.