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: