Skip to content

Commit

Permalink
BibCirculation: number of copies in item search
Browse files Browse the repository at this point in the history
* FIX Fixes the number of copies of an item that is displayed in the
  circulation UI item search. (closes #2018) (PR #3574)

* Uses `db.get_number_copies()` as fallback for displaying number of
  copies in item search when there is no 964 field.

Signed-off-by: Øystein Blixhavn <oystein@blixhavn.no>
  • Loading branch information
blixhavn authored and tiborsimko committed Mar 30, 2016
1 parent 4ab19ca commit 30e8f0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/bibcirculation/lib/bibcirculation_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 CERN.
# Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -595,6 +595,9 @@ def get_item_info_for_search_result(recid):
get_fieldvalues(recid, "260__c"))

book_copies = ' '.join(get_fieldvalues(recid, "964__a"))
if not book_copies:
book_copies = db.get_number_copies(recid)


book_infos = (book_author, book_editor, book_copies)

Expand Down

0 comments on commit 30e8f0f

Please sign in to comment.