django-commons/django-cookie-consent

Add a `CookieGroup.varname` unique constraint

Closed this issue · 0 comments

Currently this field is not contrained as being unique, but it is being used in that way in various places where the varname is used as lookup:

... and more

💥 NOTE this has the potential of breaking existing instances if they have non-unique cookie groups in their database! As such, the change must be documented properly in the release notes.

Once this is solved, we can clean up a bit of code, see #100 (comment)

Tasks

  • Add CookieGroup model unique constraint for the varname field
  • Clean up the queryset usage in all_cookie_groups implementation.
  • Document the (potential) breaking change in the changelog.