fix pycodestyle and messages

This commit is contained in:
jonaswinkler 2021-02-23 13:21:11 +01:00
parent c89779e8fc
commit 7a73e18596
2 changed files with 8 additions and 4 deletions

View File

@ -48,7 +48,10 @@ class MatchingModelSerializer(serializers.ModelSerializer):
try: try:
re.compile(match) re.compile(match)
except Exception as e: except Exception as e:
raise serializers.ValidationError(_("Invalid regular expresssion: ") + str(e)) raise serializers.ValidationError(
_("Invalid regular expresssion: %(error)s") %
{'error': str(e)}
)
return match return match

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-23 12:30+0100\n" "POT-Creation-Date: 2021-02-23 13:20+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -347,10 +347,11 @@ msgid "filter rules"
msgstr "" msgstr ""
#: documents/serialisers.py:52 #: documents/serialisers.py:52
msgid "Invalid regular expresssion: " #, python-format
msgid "Invalid regular expresssion: %(error)s"
msgstr "" msgstr ""
#: documents/serialisers.py:376 #: documents/serialisers.py:378
#, python-format #, python-format
msgid "File type %(type)s not supported" msgid "File type %(type)s not supported"
msgstr "" msgstr ""