fix uncommon exception in report system

fix html style issue in admin box on user page
This commit is contained in:
nyaadev 2018-02-06 23:05:37 +01:00
parent e5fe63156d
commit 658eefe42a
2 changed files with 31 additions and 31 deletions

View File

@ -104,21 +104,21 @@
</div>
</div>
<div class="row">
<div class="col-md-4 text-left">
<div class="col-md-3 text-left">
{% if not user.is_banned %}
{{ ban_form.ban_user(value="Ban User", class="btn btn-danger") }}
{% else %}
<button type="button" class="btn btn-danger disabled">Already banned</button>
{% endif %}
</div>
<div class="col-md-4 text-center">
<div class="col-md-3 text-center">
{% if not ipbanned %}
{{ ban_form.ban_userip(value="Ban User+IP", class="btn btn-danger") }}
{% else %}
<button type="button" class="btn btn-danger disabled">Already IP banned</button>
{% endif %}
</div>
<div class="col-md-4 text-right">
<div class="col-md-6 text-right">
{% if g.user.is_superadmin %}
{{ ban_form.nuke(value="\U0001F4A3 Nuke Torrents", class="btn btn-danger") }}
{% else %}

View File

@ -76,11 +76,11 @@ def view_reports():
report_id = report_action.report.data
torrent = models.Torrent.by_id(torrent_id)
report = models.Report.by_id(report_id)
report_user = models.User.by_id(report.user_id)
if not torrent or not report or report.status != 0:
flask.abort(404)
else:
report_user = models.User.by_id(report.user_id)
log = 'Report #{}: {} [#{}]({}), reported by [{}]({})'
if action == 'delete':
torrent.deleted = True