Commit a7e85ca8 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the controller publications/unlock_status.

parent 686e0399
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
""" """
import json import json
from plugin_dbui import CALLBACK_ERRORS from plugin_dbui import CALLBACK_ERRORS, UNDEF_ID
SQL_UNLOCK = "UPDATE publications SET id_status=%i WHERE id=%s"
def read(): def read():
...@@ -17,6 +19,15 @@ def read(): ...@@ -17,6 +19,15 @@ def read():
return json.dumps(dict(success=True, data=row.as_dict())) return json.dumps(dict(success=True, data=row.as_dict()))
def unlock_status():
"""Unlock the status OK bypassing the protection.
The publication identified by its id.
"""
# build a raw query to bypass protection (callback)
db.executesql(SQL_UNLOCK % (UNDEF_ID, request.vars.id))
def update(): def update():
"""Update a publication record identified by its id. """Update a publication record identified by its id.
Design to update record from a basic Ext.form.Panel. Design to update record from a basic Ext.form.Panel.
......
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