[open-ils-commits] r1151 - servres/trunk/conifer/syrup/views (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 29 14:34:15 EST 2010


Author: gfawcett
Date: 2010-12-29 14:34:10 -0500 (Wed, 29 Dec 2010)
New Revision: 1151

Modified:
   servres/trunk/conifer/syrup/views/items.py
Log:
fix subheading-edit bug.

Modified: servres/trunk/conifer/syrup/views/items.py
===================================================================
--- servres/trunk/conifer/syrup/views/items.py	2010-12-29 16:18:29 UTC (rev 1150)
+++ servres/trunk/conifer/syrup/views/items.py	2010-12-29 19:34:10 UTC (rev 1151)
@@ -307,11 +307,16 @@
         else:
             # generally update the item.
             data = dict((k.encode('ascii'), v.strip()) for k, v in request.POST.items())
-            if data['author2']:
-                data['author'] = '%s; %s' % (data['author1'], data['author2'])
-            else:
-                data['author'] = data['author1']
-            del data['author1']; del data['author2']
+            # TODO: fixme this is a mess. Headings don't have authors at all.
+            if 'author1' in data or 'author2' in data:
+                if data.get('author2'):
+                    data['author'] = '%s; %s' % (data['author1'], data['author2'])
+                else:
+                    data['author'] = data['author1']
+                if 'author1' in data:
+                    del data['author1']
+                if 'author2' in data:
+                    del data['author2']
             [setattr(item, k, v) for (k,v) in data.items()]
                     
         item.save()



More information about the open-ils-commits mailing list