Skip to content

Commit

Permalink
global: bibrecord dependency removal
Browse files Browse the repository at this point in the history
* INCOMPATIBLE Removes legacy bibrecord dependency.
  (addresses inveniosoftware/invenio#3233) (closes inveniosoftware#18)
  (addresses inveniosoftware/invenio#3508)

Signed-off-by: Leonardo Rossi <[email protected]>
  • Loading branch information
Leonardo Rossi committed Sep 17, 2015
1 parent 7c96b65 commit 72a3767
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
23 changes: 0 additions & 23 deletions invenio_records/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,6 @@ def __call__(self, *args, **kwargs):
name_generator = NameGenerator()


def references_nb_counts():
"""Get number of references for the record `recid`."""
recid = request.view_args.get('recid')
if recid is None:
return

from invenio.legacy.bibrecord import record_get_field_instances
from invenio_search.models import Field

from .api import get_record

if not cfg['CFG_CERN_SITE']:
reftag = ""
reftags = list(Field.get_field_tags("reference"))
if reftags:
reftag = reftags[0]
tmprec = get_record(recid)
if reftag and len(reftag) > 4:
return len(record_get_field_instances(tmprec, reftag[0:3],
reftag[3], reftag[4]))
return 0


def citations_nb_counts():
"""Get number of citations for the record `recid`."""
recid = request.view_args.get('recid')
Expand Down
17 changes: 2 additions & 15 deletions invenio_records/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,7 @@ def decorated(recid, *args, **kwargs):
flash(auth_msg, 'error')
abort(apache.HTTP_UNAUTHORIZED)

# from invenio.legacy.search_engine import record_exists, \
# get_merged_recid
# check if the current record has been deleted
# and has been merged, case in which the deleted record
# will be redirect to the new one
# record_status = record_exists(recid)
# merged_recid = get_merged_recid(recid)
# if record_status == -1 and merged_recid:
# return redirect(url_for('record.metadata', recid=merged_recid))
# elif record_status == -1:
# abort(apache.HTTP_GONE) # The record is gone!
# TODO check record status (exists, merged, deleted)

title = record.get(cfg.get('RECORDS_BREADCRUMB_TITLE_KEY'), '')
tabs = []
Expand Down Expand Up @@ -145,10 +135,7 @@ def record_context():
visible_when=visible_collection_tabs('metadata'))
def metadata(recid, of='hd', ot=None):
"""Display formated record metadata."""
# from invenio.legacy.bibrank.downloads_similarity import \
# register_page_view_event
# register_page_view_event(recid, current_user.get_id(),
# str(request.remote_addr))
# TODO add signal support
if get_output_format_content_type(of) != 'text/html':
return response_formated_records(
[g.record], of, collections=g.collection
Expand Down

0 comments on commit 72a3767

Please sign in to comment.