dbca-wa / wastd

Western Australian Sea Turtle and Strandings Database

Home Page:https://dbca-wa.github.io/wastd/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Source ID fields should default to a dynamic value, not a value calculated when migration was made

florianm opened this issue · comments

Problem

Manually entered Observations have the same static UUID4 as source_id. Does this create problems?

Reproducible example

  • Step 1: Go to
  • Step 2: Do

Changed to dynamic default following https://stackoverflow.com/a/15289517/2813717

Default set to callable. Can't use uuid field, as we have other string values in source_id already.

Only caveat: when adding an admin inline item, you must save and continue editing after each inline item, as the uuid is calculated before page load and will be re-used for any inline items added at the same time.

Good thing the LegacySourceMixin doesn't inherit its unique_together contraint for source and source_id.