From fca683226f4e767920d1b63f95f613de70ed07b1 Mon Sep 17 00:00:00 2001 From: Emanuel Dima Date: Thu, 17 Apr 2014 14:53:10 +0200 Subject: [PATCH] fixed #225 again: fresh records now not visible even for admin --- invenio/lib/record_blueprint.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/invenio/lib/record_blueprint.py b/invenio/lib/record_blueprint.py index 2a9227f841..ed9a1fd506 100644 --- a/invenio/lib/record_blueprint.py +++ b/invenio/lib/record_blueprint.py @@ -63,9 +63,12 @@ def decorated(recid, *args, **kwargs): from invenio.search_engine import record_exists, get_merged_recid if record_exists(recid) == 0: - # record doesn't exist + # record doesn't exist, abort so it doesn't get incorrectly cached abort(apache.HTTP_NOT_FOUND) # The record is gone! + if check_fresh_record(current_user, recid): + return render_template('record_waitforit.html', recid=recid) + g.collection = collection = Collection.query.filter( Collection.name == guess_primary_collection_of_a_record(recid)).\ one() @@ -83,11 +86,8 @@ def decorated(recid, *args, **kwargs): flash(_("Authorization failure"), 'error') return redirect(url_for('webaccount.login', **url_args)) elif auth_code: - if check_fresh_record(current_user, recid): - return render_template('record_waitforit.html', recid=recid) - else: - flash(auth_msg, 'error') - abort(apache.HTTP_UNAUTHORIZED) + flash(auth_msg, 'error') + abort(apache.HTTP_UNAUTHORIZED) from invenio.bibfield import get_record # check if the current record has been deleted