Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Problem: slug field in Format and FormatVersion is not ensuring uniqueness #64

Closed
sevein opened this issue Oct 25, 2017 · 3 comments · Fixed by #70
Closed

Problem: slug field in Format and FormatVersion is not ensuring uniqueness #64

sevein opened this issue Oct 25, 2017 · 3 comments · Fixed by #70

Comments

@sevein
Copy link
Member

sevein commented Oct 25, 2017

While working on #63 we found that we had two formats and their corresponding formatversions that had the very same description. The latest one added took the same slug causing MultipleObjectsReturned exceptions.

I think that the slug fields for these two models should be updated so they ensure uniqueness. This is something that the old django-slugfield seems to support out of the box. Perhaps we can also move to Django's SlugField?

@sevein
Copy link
Member Author

sevein commented Nov 24, 2017

How to reproduce:

  1. Go to formats
  2. Add a new format
  3. Use description: ADX Audio Format

You will be redirected to the new record. The slug given will clash with the existing adx-audio-format causing the following error:

MultipleObjectsReturned at /format/adx-audio-format/

get() returned more than one Format -- it returned 2!

@ablwr
Copy link
Contributor

ablwr commented Oct 1, 2018

This seems like it was resolved? I know when testing, slugs will add -1, -2, -3 if something with the same slug already exists.

@sevein
Copy link
Member Author

sevein commented Oct 1, 2018

I think so, sounds like #70 fixed it! It's funny, I look at #70 and I can barely remember I did that... 🤔

@sevein sevein closed this as completed Oct 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants