support for spaces in fixed wluri-s
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 14 Aug 2012 12:20:32 +0000 (14:20 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 14 Aug 2012 12:20:32 +0000 (14:20 +0200)
apps/catalogue/management/commands/fixdc.py

index 80b341c..a80352d 100644 (file)
@@ -18,7 +18,8 @@ class FixDC(XmlUpdater):
         try:
             WLURI.strict(elem.text)
         except ValidationError:
-            correct_field = unicode(WLURI.from_slug(WLURI(elem.text).slug))
+            correct_field = unicode(WLURI.from_slug(
+                                WLURI(elem.text.strip()).slug))
             if verbose:
                 print "Changing %s from %s to %s" % (
                         elem.tag, elem.text, correct_field