Commit 17bd094e authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

The controller edit_insert returns an alert when the record does not exist.

parent 0a673298
......@@ -27,7 +27,7 @@ from plugin_dbui import (get_id,
MODE_DRY_RUN = T(DRY_RUN)
MSG_NO_REG_INSTITUTE = T("Preference REG_INSTITUTE is not defined.")
MSG_NO_HARVESTER = T("No harvesters for your selection !!!")
MSG_NO_RECORD = "Sorry, the record does not exist."
def free_run():
"""Run a free harvester.
......@@ -119,6 +119,13 @@ def edit_insert():
# record
record = load_record(selector.host, selector.record_id)
if record is None:
# NOTE
# Bug in plugin dbui 0.7.1 in INLINE_ALERT
msg = '<script>Ext.Msg.alert("%s", "%s");</script>'
msg = msg % (T('Error'), T(MSG_NO_RECORD))
return msg
# form configuration
cfg = to_formPanel(db.publications)
......
......@@ -583,6 +583,7 @@
'Several publications refer to it.': 'Several publications refer to it.',
'Sign Up': 'Sign Up',
'Software versions': 'Version des logiciels',
'Sorry, the record does not exist.': "Désolé, cette notice n'existe pas.",
'Sort by': 'Trier par',
'Sort field': 'Trier par',
'Sort Field': 'Trier par',
......
# -*- coding: utf-8 -*-
"""test invenio_tools functions
"""
from invenio_tools import load_record
def test_load_record():
assert load_record('inspirehep.net', 150806128) is None
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment