Python
- 9 ответов
- 0 вопросов
3
Вклад в тег
@blueprint.route("/event/delete/<int:event_id>", methods=['GET'])
@login_required
def event_del(event_id):
event = Event.query.filter_by(id=event_id, user_id=current_user.id).first()
if event:
event.delete()
flash("Event is deleted", 'success')
else:
flash("Event can not deleted", 'error')
return redirect(url_for('events_list'))