From 85c97f3dd47c4542b3638c3498e3827d2a3f2563 Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Sat, 31 Dec 2022 16:40:44 +0500 Subject: [PATCH] =?UTF-8?q?=D0=93=D1=80=D1=83=D0=BF=D0=BF=D0=B0=20=D0=BE?= =?UTF-8?q?=D0=B4=D0=BD=D0=BE=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=BD=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2=20=D1=83=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=D1=81=D1=8F=20=D0=B2=20=D0=BD=D0=B0=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=B9=D0=BA=D0=B0=D1=85=20#40?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 3 ++- cms/promoters.py | 3 ++- crossposting_backend/settings.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 62a9203..46797a7 100644 --- a/.env.example +++ b/.env.example @@ -6,4 +6,5 @@ VK_PASSWORD=123123 VK_OWNER_ID=-2 OK_ACCESS_TOKEN=aatk OK_APPLICATION_KEY=FFCF -OK_APPLICATION_SECRET_KEY=GGD \ No newline at end of file +OK_APPLICATION_SECRET_KEY=GGD +OK_GROUP_ID=700 \ No newline at end of file diff --git a/cms/promoters.py b/cms/promoters.py index 1d0d7df..6baf74a 100644 --- a/cms/promoters.py +++ b/cms/promoters.py @@ -63,6 +63,7 @@ class OdnoklassnikiPromoter(Promoter): ok_access_token = promoter_secrets['OK_ACCESS_TOKEN'] ok_application_key = promoter_secrets['OK_APPLICATION_KEY'] ok_application_secret_key = promoter_secrets['OK_APPLICATION_SECRET_KEY'] + ok_group_id = promoter_secrets['OK_GROUP_ID'] session = ok_api.OkApi(access_token=ok_access_token, application_key=ok_application_key, @@ -82,7 +83,7 @@ class OdnoklassnikiPromoter(Promoter): encoded_attachments = JSONEncoder().encode(attachments) try: session.mediatopic.post(type='GROUP_THEME', - gid='70000001426867', + gid=ok_group_id, attachment=encoded_attachments) except ok_api.OkApiException as exc: raise PromoteError(exc) diff --git a/crossposting_backend/settings.py b/crossposting_backend/settings.py index 9cb42be..a014fdd 100644 --- a/crossposting_backend/settings.py +++ b/crossposting_backend/settings.py @@ -42,7 +42,7 @@ dotenv.read_dotenv(env_file) promoter_env_keys = ( 'TELEGRAM_BOT_TOKEN', 'TELEGRAM_CHAT_ID', 'JOOMLA_TOKEN', 'VK_LOGIN', 'VK_PASSWORD', 'VK_OWNER_ID', 'OK_ACCESS_TOKEN', 'OK_APPLICATION_KEY', - 'OK_APPLICATION_SECRET_KEY', + 'OK_APPLICATION_SECRET_KEY', 'OK_GROUP_ID', ) promoter_secrets = {} if ENV_ENCODED: