]> git.parisson.com Git - teleforma.git/commitdiff
reactivate mail and ftp
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 8 Mar 2021 09:20:06 +0000 (10:20 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 8 Mar 2021 09:20:06 +0000 (10:20 +0100)
teleforma/management/commands/teleforma-export-avis.py

index 2d9a17c2c2f11ae18c5b0b95cb927a4a19382a52..72b65cf6bdf8c09cc4a54638ccc8dc16a3e8611a 100644 (file)
@@ -153,22 +153,22 @@ class Command(BaseCommand):
 
         self.log('Sending csv to ftp...')
 
-        ftp = FTP(self.FTP_HOST)
-        try:
-            ftp.login(self.FTP_LOGIN, self.FTP_PASSWORD)
-            ftp.cwd(self.FTP_PATH)
-            ftp.storlines("STOR export-orders%s.csv" % str(date.today()), output)
-            ftp.quit()
-        except:
-            ftp.close()
-            self.log('Error while uploading to FTP')
-            raise
-        self.log('Sending csv to ftp done')
-
-        send_mail(
-            "Rapport export d'avis",
-            self.logs,
-            settings.DEFAULT_FROM_EMAIL,
-            settings.REPORT_TO_EMAIL,
-            fail_silently=False,
-        )
+        ftp = FTP(self.FTP_HOST)
+        try:
+            ftp.login(self.FTP_LOGIN, self.FTP_PASSWORD)
+            ftp.cwd(self.FTP_PATH)
+            ftp.storlines("STOR export-orders%s.csv" % str(date.today()), output)
+            ftp.quit()
+        except:
+            ftp.close()
+            self.log('Error while uploading to FTP')
+            raise
+        self.log('Sending csv to ftp done')
+
+        send_mail(
+            "Rapport export d'avis",
+            self.logs,
+            settings.DEFAULT_FROM_EMAIL,
+            settings.REPORT_TO_EMAIL,
+            fail_silently=False,
+        )