X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/11da6ea358e7b059888fd4d8a1af2edb739d1762..3b0d1718ec6c9dddcee4a4620384a83e30ff6f2f:/apps/catalogue/management/commands/fixdc.py diff --git a/apps/catalogue/management/commands/fixdc.py b/apps/catalogue/management/commands/fixdc.py index a80352d7..3f997d0c 100644 --- a/apps/catalogue/management/commands/fixdc.py +++ b/apps/catalogue/management/commands/fixdc.py @@ -20,6 +20,11 @@ class FixDC(XmlUpdater): except ValidationError: correct_field = unicode(WLURI.from_slug( WLURI(elem.text.strip()).slug)) + try: + WLURI.strict(correct_field) + except ValidationError: + # Can't make a valid WLURI out of it, leave as is. + return False if verbose: print "Changing %s from %s to %s" % ( elem.tag, elem.text, correct_field