From: Radek Czajka Date: Tue, 22 Aug 2023 14:50:51 +0000 (+0200) Subject: fix X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/07184f3d87ef093639e4eb908cee45cf69c4a0bb?ds=inline fix --- diff --git a/src/depot/publishers/woblink.py b/src/depot/publishers/woblink.py index c373d81c..83fb3174 100644 --- a/src/depot/publishers/woblink.py +++ b/src/depot/publishers/woblink.py @@ -523,6 +523,10 @@ class Woblink(BasePublisher): sleep(2) def upload_file(self, woblink_id, filename, content, field_name, mime_type): + form_name = f'Upload{field_name}' + id_field = f'pub{field_name}ResId' + field_name = field_name.lower() + data = { 'pubId': woblink_id, } @@ -530,10 +534,6 @@ class Woblink(BasePublisher): field_name: (filename, content, mime_type) } - form_name = f'Upload{field_name}' - id_field = f'pub{field_name}ResId' - field_name = field_name.lower() - response = self.session.post( self.UPLOAD_URL % field_name, data=self.with_form_name(data, form_name),