[damned-lies] forms.py: Add support for .xz compressed files



commit f80b88f4106923ba20067f62761cf357efae77cf
Author: Rafael Fontenelle <rffontenelle gmail com>
Date:   Fri Aug 10 18:46:38 2018 +0000

    forms.py: Add support for .xz compressed files

 vertimus/forms.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vertimus/forms.py b/vertimus/forms.py
index 65e40b2b..35dd9d99 100644
--- a/vertimus/forms.py
+++ b/vertimus/forms.py
@@ -56,7 +56,7 @@ class ActionForm(forms.Form):
         required=False
     )
     file = forms.FileField(label=_("File"), required=False,
-                           help_text=_("Upload a .po, .gz, .bz2 or .png file"))
+                           help_text=_("Upload a .po, .gz, .bz2, .xz or .png file"))
     send_to_ml = forms.BooleanField(label=_("Send message to the team mailing list"), required=False)
 
     def __init__(self, current_user, state, actions, has_mailing_list, *args, **kwargs):
@@ -80,8 +80,8 @@ class ActionForm(forms.Form):
         data = self.cleaned_data['file']
         if data:
             ext = os.path.splitext(data.name)[1]
-            if ext not in ('.po', '.gz', '.bz2', '.png'):
-                raise ValidationError(_("Only files with extension .po, .gz, .bz2 or .png are admitted."))
+            if ext not in ('.po', '.gz', '.bz2', '.xz', '.png'):
+                raise ValidationError(_("Only files with extension .po, .gz, .bz2, .xz or .png are 
admitted."))
             # If this is a .po file, check validity (msgfmt)
             if ext == '.po':
                 if check_po_conformity(data):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]