From 37dab8f9ef681bfba763ee4f279c9babd49de783 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 14 Aug 2012 14:33:52 +0200 Subject: [PATCH] fixdc: only change wluri if it's fixable --- apps/catalogue/management/commands/fixdc.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.20.1