[open-ils-commits] r280 - in servres/trunk/conifer: syrup templates (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Apr 5 17:25:59 EDT 2009
Author: gfawcett
Date: 2009-04-05 17:25:54 -0400 (Sun, 05 Apr 2009)
New Revision: 280
Modified:
servres/trunk/conifer/syrup/models.py
servres/trunk/conifer/templates/item_add_cat_search.xhtml
Log:
argh, bugfix in model. Minor tweak to template.
Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py 2009-04-05 21:17:25 UTC (rev 279)
+++ servres/trunk/conifer/syrup/models.py 2009-04-05 21:25:54 UTC (rev 280)
@@ -599,13 +599,15 @@
def save(self, force_insert=False, force_update=False):
# Must ensure that barcode is unique for non-departed items. Same with smallint
try:
+ unique_thing = 'barcode'
already = PhysicalObject.objects.exclude(pk=self.id).get(departed=None)
+ unique_thing = 'smallint'
if self.smallint:
- already = PhysicalObject.objects.exclude(pk=self.id).get(smallint=smallint)
+ already = PhysicalObject.objects.exclude(pk=self.id).get(smallint=self.smallint)
except PhysicalObject.DoesNotExist:
super(PhysicalObject, self).save(force_insert, force_update)
else:
- raise AssertionError, 'barcode is not unique in active PhysicalObject collection.'
+ raise AssertionError, '%s is not unique in active PhysicalObject collection.' % unique_thing
@classmethod
def by_smallint(cls, smallint):
Modified: servres/trunk/conifer/templates/item_add_cat_search.xhtml
===================================================================
--- servres/trunk/conifer/templates/item_add_cat_search.xhtml 2009-04-05 21:17:25 UTC (rev 279)
+++ servres/trunk/conifer/templates/item_add_cat_search.xhtml 2009-04-05 21:25:54 UTC (rev 280)
@@ -30,7 +30,7 @@
<input type="submit" value="Search"/>
</form>
- <table class="pagetable">
+ <table class="pagetable" py:if="request.method == 'POST'">
<thead>
<tr><th>Title</th><th>Author</th><th>Publisher</th><th>PubDate</th></tr>
</thead>
More information about the open-ils-commits
mailing list