Skip to content

Commit

Permalink
Merge pull request #333 from HEPData/fix-review-calls
Browse files Browse the repository at this point in the history
Avoid making calls to review methods when not logged in
  • Loading branch information
GraemeWatt committed Apr 22, 2021
2 parents 52daa3b + 0128d6d commit fb592f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hepdata/modules/records/assets/js/hepdata_tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ HEPDATA.table_renderer = {
HEPDATA.table_renderer.attach_row_listener(table_placement, 'histogram');
}
window.MathJax.typeset();
HEPDATA.table_renderer.update_reviewer_button(table_data.review);
if (HEPDATA.show_review) {
HEPDATA.table_renderer.update_reviewer_button(table_data.review);
}

$("#hepdata_table_loader").addClass("hidden");
$("#hepdata_table_content").removeClass("hidden");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

HEPDATA.upload_max_size = {{ config['UPLOAD_MAX_SIZE']|default(52000000) }};
HEPDATA.upload_timeout = {{ config['NGINX_TIMEOUT']|default(298) }};
HEPDATA.show_review = {{ 'true' if ctx.status == "todo" and (ctx.show_review_widget or ctx.show_upload_widget) else 'false'}};

HEPDATA.hepdata_record.initialise();
HEPDATA.hepdata_resources.initialise({{ ctx.recid|default(0) }}, {{ ctx.version|default(0) }});
Expand Down

0 comments on commit fb592f0

Please sign in to comment.