Created
March 27, 2011 19:37
-
-
Save mdornseif/889509 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cs/ablage.py b/cs/ablage.py | |
index 7ec72b1..74adcba 100644 | |
--- a/cs/ablage.py | |
+++ b/cs/ablage.py | |
@@ -31,8 +31,12 @@ def store(akte_id, pdfdata, typ, datum, quelle, ref, obj=None, **kwargs): | |
* kwargs moegen weitere Argumente, die d-ablage verarbeitet, sein. | |
""" | |
# ref in einen Unicode String umwandeln | |
- if isinstance(ref, list): | |
- ref = u' '.join([unicode(x) for x in ref if x]) | |
+ if not isinstance(ref, list): | |
+ raise RuntimeError("Parameter `ref` muss eine Liste sein") | |
+ | |
+ # Den Inhalt von Ref in einen Unicode String umwandeln | |
+ ref = [unicode(x) for x in ref if x] | |
+ | |
# File-Like Objekt aus den PDF erstellen, wie fetch es zum Upload erfordert. | |
pdfdata = StringIO.StringIO(pdfdata) | |
pdfdata.name = '%s.pdf' % akte_id | |
@@ -40,7 +44,8 @@ def store(akte_id, pdfdata, typ, datum, quelle, ref, obj=None, **kwargs): | |
if not all([akte_id, typ, datum, quelle]): | |
raise ValueError("Some values are missing: %r %r %r %r" % (akte_id, typ, datum, quelle)) | |
# Die fixen Parameter um weitere Parameter aus den kwargs erg<C3><A4>nzen. | |
- uploaddict = dict(pdfdata=pdfdata, type=typ, datum=str(datum), quelle=quelle, ref=[akte_id] + ref) | |
+ uploaddict = dict(pdfdata=pdfdata, type=typ, datum=str(datum), quelle=quelle, | |
+ ref=' '.join([akte_id] + ref)) | |
uploaddict.update(kwargs) | |
# Die Parameter um weitere Parameter aus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment