From 07184f3d87ef093639e4eb908cee45cf69c4a0bb Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 22 Aug 2023 16:50:51 +0200 Subject: [PATCH 1/1] fix --- src/depot/publishers/woblink.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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), -- 2.20.1