Skip to content

Issue in License model #14093

@etj

Description

@etj

Expected Behavior

The identifier should be unique and notnull.
Also, not being the database PK, it should be editable.

Actual Behavior

The identifier can be empty and duplicated.
It can not be edited in the admin page:

Image

It means that only licenses loaded from fixtures have a non empty identifier

The metadata editor relies on the identifier field. This means that when a metadata using one of the licenses added in the admin page is saved, the server procedures will try and load a license filtering by an empty identifier, raising an error (get() returned more than one License).

TODO:

  • make identifier editable (also, a design decision should be about the semantics of the identifier and abbreviation field)
  • make identifier unique
    • change the model
    • add backward-safe migrations in order to populate the identifier field if empty
  • change the metadata editor procedures to use the id instead of the identifier

Steps to Reproduce the Problem

  1. create a couple of new licenses
  2. edit a resource metadata using one of them
  3. save the resource and check the logs

Specifications

  • GeoNode version: 5.0, master

Metadata

Metadata

Assignees

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