Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Ignore orphaned translations in slug uniqueness checks
Browse files Browse the repository at this point in the history
When checking for *real* uniqueness clashes for
`slug` or URL values instead of bogus ones
triggered by draft & published copies, also ignore
translation records without a known master which
can be created in some circumstances but which
are really bad orphaned records we should ignore.

See https://github.com/ixc/biennale-of-sydney/issues/45
  • Loading branch information
jmurty committed Dec 11, 2017
1 parent b593e28 commit 8ec5cd9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions icekit/publishing/monkey_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def patch_urlnodeadminform_clean_for_publishable_items(self):

other_translations = UrlNode_Translation.objects.all()

# Ignore other translations without a `master`, which we cannot reason
# about in any way and are most likely just orphaned bad data.
other_translations = other_translations.exclude(master=None)

# If a duplicate slug error is reported, make sure it is *really*
# a duplicate slug instead of just a slug value shared between the
# published and draft versions of a publishable item. This section
Expand Down

0 comments on commit 8ec5cd9

Please sign in to comment.