From c13d4a9520b6ab9ac9317290545eaa62304c9470 Mon Sep 17 00:00:00 2001 From: gitadmin Date: Sun, 12 Oct 2025 18:07:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D1=83=D0=B1=D0=BB=D1=8F=20get?= =?UTF-8?q?=5Fvenue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_edit.py | 21 --------------------- templates/edit_post.html | 4 ++-- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/db_edit.py b/db_edit.py index 77daadc..0d14293 100644 --- a/db_edit.py +++ b/db_edit.py @@ -141,17 +141,6 @@ class DatabaseManager: cursor.execute("SELECT * FROM events WHERE id = %s", (event_id,)) return cursor.fetchone() - def get_venues(self): - """Получает список всех уникальных площадок из таблицы events""" - with self.conn.cursor() as cursor: - cursor.execute(""" - SELECT DISTINCT unit_name - FROM events - WHERE unit_name IS NOT NULL AND unit_name != '' - ORDER BY unit_name - """) - return cursor.fetchall() - def toggle_event_publication(self, event_id): with self.conn.cursor() as cursor: cursor.execute(""" @@ -610,16 +599,6 @@ def logout(): log_event(f"Пользователь {username} вышел из системы с IP {client_ip}") return redirect(url_for('zilant.login')) -@bp.route('/api/venues') -@login_required -def api_venues(): - db = get_db() - try: - venues = db.get_venues() - return jsonify(venues) - finally: - db.close() - @bp.route('/api/posts') @login_required def api_posts(): diff --git a/templates/edit_post.html b/templates/edit_post.html index fb3a79b..276473e 100644 --- a/templates/edit_post.html +++ b/templates/edit_post.html @@ -260,8 +260,8 @@ // Добавляем площадки venues.forEach(venue => { const option = document.createElement('option'); - option.value = venue.unit_name; - option.textContent = venue.unit_name; + option.value = venue.name; + option.textContent = venue.name; select.appendChild(option); }); } catch (error) {