Sent emails log: add read (eye) and delete buttons matching files page style
This commit is contained in:
parent
d31af062ed
commit
7a9a69c86d
2 changed files with 40 additions and 13 deletions
18
app.py
18
app.py
|
|
@ -3574,12 +3574,18 @@ def delete_journal_entry(message_id):
|
|||
@login_required
|
||||
def delete_sent_email(sent_id):
|
||||
"""Löscht einen einzelnen Outbox-Eintrag."""
|
||||
con = sqlite3.connect(EMAIL_JOURNAL_DB)
|
||||
con.execute("DELETE FROM sent_emails WHERE id = ?", (sent_id,))
|
||||
con.commit()
|
||||
con.close()
|
||||
flash('Gesendete Email aus Log gelöscht.', 'success')
|
||||
return redirect(url_for('email_log_view'))
|
||||
try:
|
||||
con = sqlite3.connect(EMAIL_JOURNAL_DB)
|
||||
con.execute("DELETE FROM sent_emails WHERE id = ?", (sent_id,))
|
||||
con.commit()
|
||||
con.close()
|
||||
# JSON für fetch()-Aufrufe, Redirect-Fallback für direkte Formular-Posts
|
||||
if 'application/json' in request.headers.get('Accept', ''):
|
||||
return jsonify({'success': True})
|
||||
flash('Gesendete Email aus Log gelöscht.', 'success')
|
||||
return redirect(url_for('emails'))
|
||||
except Exception as e:
|
||||
return jsonify({'success': False, 'message': str(e)}), 500
|
||||
|
||||
|
||||
@app.route('/email-log')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue