Skip to content

Commit 12e58e2

Browse files
authored
Merge pull request #12 from ThreeSixtyGiving/non-unique-id-values-add-explanatory-text
Explanatory text for non-unique-id values
2 parents 0fffcf1 + aacfc92 commit 12e58e2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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)

0 commit comments

Comments
 (0)