This commit is contained in:
-21
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user