From 6afbb3afed3934f9285bc7e9f664de0bb8c9682e1a7dd744732def181014dcac Mon Sep 17 00:00:00 2001 From: Vladislav Date: Tue, 21 Jul 2026 05:16:55 -0400 Subject: [PATCH] fix --- templates/posts/edit.html | 22 ++++++++++++---------- vk.ipynb | 2 +- vk.py | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/templates/posts/edit.html b/templates/posts/edit.html index 0a04dc7..350d2f0 100644 --- a/templates/posts/edit.html +++ b/templates/posts/edit.html @@ -5,7 +5,7 @@ - {% if user.get('grade') is none %} + {% if user.get('grade') is none or 'galerist' in user.get('roles') %}
@@ -57,19 +57,21 @@ const fileInput = document.getElementById('fileInput'); const preview = document.getElementById('preview'); document.getElementById('author').value = post.author; - - document.getElementById('grade').value = post.grade; + if (document.getElementById('grade')){ + document.getElementById('grade').value = post.grade; - const inputEl = document.getElementById('grade'); + const inputEl = document.getElementById('grade'); - let list = inputEl.dataset.list; - list = JSON.parse(list.replace(/'/g, '"')); + let list = inputEl.dataset.list; + list = JSON.parse(list.replace(/'/g, '"')); - list.push(post.grade); - list = [...new Set(list)]; + list.push(post.grade); + list = [...new Set(list)]; - inputEl.dataset.list = JSON.stringify(list); - inputEl.dataset.value = post.grade; + inputEl.dataset.list = JSON.stringify(list); + inputEl.dataset.value = post.grade; + + } document.getElementById('title').value = post.title; document.getElementById('city').value = post.city; diff --git a/vk.ipynb b/vk.ipynb index ab4df6e..19ce812 100644 --- a/vk.ipynb +++ b/vk.ipynb @@ -462,7 +462,7 @@ " try:\n", " logging.info(f\"VK начало публикации {item} {file_ids}\")\n", " res = httpx.post(\n", - " 'http://kultmost-api.kultmost/api/v1/social/vk/send',\n", + " 'http://127.0.0.1:30080/api/v1/social/vk/send',\n", " headers={\"Authorization\": f\"bearer {ATOKEN}\"},\n", " json={'item': item, 'text': text, 'file_ids': file_ids, 'doc': social, 'sign_avatar': sign_avatar},\n", " timeout=100\n", diff --git a/vk.py b/vk.py index afe2239..7907baf 100644 --- a/vk.py +++ b/vk.py @@ -357,7 +357,7 @@ def notify(self, item: dict, text: str, file_ids: list, social: dict, sign_avata try: logging.info(f"VK начало публикации {item} {file_ids}") res = httpx.post( - 'http://kultmost-api.kultmost/api/v1/social/vk/send', + 'http://127.0.0.1:30080/api/v1/social/vk/send', headers={"Authorization": f"bearer {ATOKEN}"}, json={'item': item, 'text': text, 'file_ids': file_ids, 'doc': social, 'sign_avatar': sign_avatar}, timeout=100