From a06e5b9e63d60d4ad55b050535fe374e4c8d0b60 Mon Sep 17 00:00:00 2001 From: gfawcett Date: Wed, 29 Dec 2010 19:34:10 +0000 Subject: [PATCH] fix subheading-edit bug. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1151 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/syrup/views/items.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/conifer/syrup/views/items.py b/conifer/syrup/views/items.py index fad6e46..d6a83e0 100644 --- a/conifer/syrup/views/items.py +++ b/conifer/syrup/views/items.py @@ -307,11 +307,16 @@ def item_edit(request, site_id, item_id): 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() -- 2.11.0