Skip to content

Updating an existing Snippet results in invalid error message #176

Open
@bartTC

Description

@bartTC

When you update an existing snippet, the admin will throw an error message "A Snippet with this name already exists."

Looks like the issue is the clean method, it literally checks if that snippet exists already. This makes sense for new snippets, but not for updating existing ones.

https://github.com/django-cms/djangocms-snippet/blob/master/src/djangocms_snippet/forms.py#L37-L46

Steps to reproduce:

  • Go to Admin > Snippets > Snippet
  • Add a new Snippet
  • Add any name and HTML content
  • Hit "Save and continue editing"
  • Hit "Save and continue editing" again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions