diff --git a/invenio_records/utils.py b/invenio_records/utils.py index 49825c9d..e750011a 100644 --- a/invenio_records/utils.py +++ b/invenio_records/utils.py @@ -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') diff --git a/invenio_records/views.py b/invenio_records/views.py index faf10265..69b5a7d5 100644 --- a/invenio_records/views.py +++ b/invenio_records/views.py @@ -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 = [] @@ -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