mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-20 10:05:58 +00:00
Disable report button on empty reason (#374)
Previously, people couldn't quite tell you needed to give a report reason. Now we disable the submit button until there is a reason, and flask.flash() if someone manages to submit an empty reason anyway.
This commit is contained in:
@@ -376,6 +376,8 @@ def submit_report(torrent_id):
|
||||
db.session.add(report)
|
||||
db.session.commit()
|
||||
flask.flash('Successfully reported torrent!', 'success')
|
||||
elif len(form.reason.data) == 0:
|
||||
flask.flash('Please give a report reason!', 'danger')
|
||||
|
||||
return flask.redirect(flask.url_for('torrents.view', torrent_id=torrent_id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user