]> git.ipfire.org Git - thirdparty/patchwork.git/commit
models: Add State.slug field
authorStephen Finucane <stephen@that.guru>
Fri, 20 Dec 2019 10:49:21 +0000 (10:49 +0000)
committerStephen Finucane <stephen@that.guru>
Fri, 27 Dec 2019 12:53:37 +0000 (12:53 +0000)
commit42b1dfa2c9de81b6a63f915c9cd989dc9dcf32be
tree5d369f41c3888b1773eb5af224b5371a5b0c0654
parentcd3a2ce81ae4595fceb82edd43488f6f2422371e
models: Add State.slug field

This reduces a lot of the tech debt we had built up around this. This
field is populated from a slugified representation of State.name and has
a uniqueness constraint. As a result, we also need to a uniqueness
constraint to the State.name field. This shouldn't be an issue and
probably should have been used from day one.

Note that there is no REST API impact for this since we've been using
state slugs all along.

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/api/event.py
patchwork/api/patch.py
patchwork/fixtures/default_states.xml
patchwork/migrations/0038_state_slug.py [new file with mode: 0644]
patchwork/models.py
patchwork/tests/api/test_patch.py
patchwork/tests/utils.py