diff --git a/ckanext/datarequests/controllers/controller_functions.py b/ckanext/datarequests/controllers/controller_functions.py index 738f11c..dcf65ec 100644 --- a/ckanext/datarequests/controllers/controller_functions.py +++ b/ckanext/datarequests/controllers/controller_functions.py @@ -449,6 +449,8 @@ def comment(id): h.flash_notice(flash_message) + return tk.redirect_to(tk.url_for('datarequest.comment', id=id)) + except tk.NotAuthorized as e: log.warning(e) return tk.abort(403, tk._('You are not authorized to %s' % action_text)) diff --git a/ckanext/datarequests/templates/datarequests/comment.html b/ckanext/datarequests/templates/datarequests/comment.html index ce45408..d2c50ba 100644 --- a/ckanext/datarequests/templates/datarequests/comment.html +++ b/ckanext/datarequests/templates/datarequests/comment.html @@ -13,7 +13,7 @@ {% if h.check_access('comment_datarequest', {'id':c.datarequest.id }) %}
- {% set create_comment_error = c.updated_comment is defined and c.updated_comment.id == '' %} + {% set create_comment_error = c.updated_comment is defined and c.updated_comment['comment']['id'] == '' %} {% if create_comment_error %} diff --git a/ckanext/datarequests/templates/datarequests/snippets/comment_item.html b/ckanext/datarequests/templates/datarequests/snippets/comment_item.html index 6ed549b..657c6c9 100644 --- a/ckanext/datarequests/templates/datarequests/snippets/comment_item.html +++ b/ckanext/datarequests/templates/datarequests/snippets/comment_item.html @@ -37,7 +37,7 @@
{% if can_update %} - {% snippet "datarequests/snippets/comment_form.html", comment_id=comment.id, datarequest=datarequest, errors=errors, errors_summary=errors_summary, initial_text=updated_comment.comment if focus else comment.comment, focus=focus %} + {% snippet "datarequests/snippets/comment_form.html", comment_id=comment.id, datarequest=datarequest, errors=errors, errors_summary=errors_summary, initial_text=updated_comment.comment.comment if focus else comment.comment, focus=focus %} {% endif %} diff --git a/ckanext/datarequests/templates/emails/bodies/update_datarequest.txt b/ckanext/datarequests/templates/emails/bodies/update_datarequest.txt index f320902..c2f37f9 100644 --- a/ckanext/datarequests/templates/emails/bodies/update_datarequest.txt +++ b/ckanext/datarequests/templates/emails/bodies/update_datarequest.txt @@ -4,6 +4,6 @@ To view the data access request, follow this link: {{ site_url }}/datarequest/{{ datarequest.id }} Requested data: {{ datarequest.title }} -Current of status: {{ datarequest.status }} +Current status: {{ datarequest.status }} Do not reply to this email.