Skip to content

ValidationError when updating an instance of the Photo model in the admin form #1

@flebel

Description

@flebel

ValidationError: [u'Select a valid choice. That choice is not one of the available choices.']

This exception is thrown when a model instance is being updated from the admin form. It is caused by the following line in the save method of the Photo model:
ExifTag.objects.create(key=key, value=metadata[key].human_value, photo=self)

I have yet to find a sane explanation. The ExifTag instances belonging to the photo are being deleted before they are recreated, but it doesn't fix it. For now, the unsatisfactory solution is that the EXIF tags are no longer updated when a photo is saved. This can be an issue right now as the actual JPEG files can be updated for a model instance, which will result in incoherent EXIF metadata for that file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions