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) {