From 7a73e1859660c68b3ca254cd879aa188e7d561c5 Mon Sep 17 00:00:00 2001 From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com> Date: Tue, 23 Feb 2021 13:21:11 +0100 Subject: [PATCH] fix pycodestyle and messages --- src/documents/serialisers.py | 5 ++++- src/locale/en_US/LC_MESSAGES/django.po | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index 652e5fe30..adda7117e 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -48,7 +48,10 @@ class MatchingModelSerializer(serializers.ModelSerializer): try: re.compile(match) 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 diff --git a/src/locale/en_US/LC_MESSAGES/django.po b/src/locale/en_US/LC_MESSAGES/django.po index c234d5c2a..27d628455 100644 --- a/src/locale/en_US/LC_MESSAGES/django.po +++ b/src/locale/en_US/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -347,10 +347,11 @@ msgid "filter rules" msgstr "" #: documents/serialisers.py:52 -msgid "Invalid regular expresssion: " +#, python-format +msgid "Invalid regular expresssion: %(error)s" msgstr "" -#: documents/serialisers.py:376 +#: documents/serialisers.py:378 #, python-format msgid "File type %(type)s not supported" msgstr ""