[Zope3-checkins] CVS: Zope3/src/zope/app/browser/content - fssync.py:1.11

Guido van Rossum guido@python.org
Thu, 15 May 2003 18:25:46 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/content
In directory cvs.zope.org:/tmp/cvs-serv13943

Modified Files:
	fssync.py 
Log Message:
Set the transaction note.  There's a hack here because the query
string is ignored (due to the non-standard content-type on the POST
request).


=== Zope3/src/zope/app/browser/content/fssync.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/content/fssync.py:1.10	Thu May 15 18:10:50 2003
+++ Zope3/src/zope/app/browser/content/fssync.py	Thu May 15 18:25:46 2003
@@ -144,7 +144,14 @@
 
     def do_commit(self, zipdata):
         # 000) Set transaction note
-        note = self.request.get("note") or "fssync"
+        note = self.request.get("note")
+        if not note:
+            # XXX Hack because cgi doesn't parse the query string
+            qs = self.request._environ.get("QUERY_STRING")
+            if qs and qs.startswith("note="):
+                note = qs[5:]
+                import urllib
+                note = urllib.unquote(note)
         if note:
             get_transaction().note(note)
         # 00) Allocate temporary names