File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
cove/cove_360/templatetags Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ from cove .html_error_msg import html_error_msg
2
+ from cove .templatetags .cove_tags import register
3
+ from django .utils .html import mark_safe
4
+ from django .utils .translation import gettext_lazy as _
5
+
6
+
7
+ @register .filter (name = 'html_error_msg' )
8
+ def html_error_msg_360 (error ):
9
+ """
10
+ Replaces default `html_error_msg` and then chains up with the implementation of lib-cove-web.
11
+ """
12
+ if error ["error_id" ] == "uniqueItems_with_id" :
13
+ return mark_safe (_ (
14
+ "Non-unique id values. There are grants in your data with the same Id. "
15
+ "Each Id must be unique so the grants can be distinguished from each other. "
16
+ "If there are duplicate grant records in your data these should be removed. "
17
+ "If different grants have the same Id these should be updated to make them unique. "
18
+ "<a href=\" https://standard.threesixtygiving.org/en/latest/identifiers/#grant-identifier\" target=\" _blank\" >(more info)</a>"
19
+ ))
20
+
21
+ return html_error_msg (error )
You can’t perform that action at this time.
0 commit comments