Skip to content

Clean up accept/decline view interface #106

@sergei-maertens

Description

@sergei-maertens

From: #100 (comment)

The cookie (group) accept/decline views now get their varnames from the Django URL patterns, where the varnames are a comma-separated string. Reversing this URL for all groups leads to double final slashes: accept// because there are no items. Validating this input is also harder than it should be.

Instead, these views should always be POST-ed to, never GET (since they need to be CSRF protected) and therefore we should use proper form data for this purposes. This in turn also allows us to clean up the URL patterns a bit and simplify the cookie bar Javascript.

💥 NOTE this is a potential breaking changes for those users that have set up custom templates to accept/decline cookie groups. It is expected that they use the template tags to craft the appropriate URLs, so perhaps we can provide a backwards compatible approach where the query params are added to the URL, which should then still end up in the POST data. We can then deprecate those templatetags but keep them around until 2.0 to minimize impact?

Tasks

  • Use proper django.forms.Form for cookie group varname input
  • Use proper form handling instead of URL params to accept/decline cookie groups
  • Perhaps make it an explicit input that all groups are accepted/declined?
  • Update documentation and example/reference project

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions