Skip to content

Commit

Permalink
Add placeholder to notify users submitting a log of reports
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Apr 10, 2024
1 parent e5efe6d commit 171176c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions repologyapp/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,15 @@ def project_report(name: str) -> Response:
comment
)

flask.flash('Report for {} added successfully and will be processed in a few days, thank you!'.format(name), 'success')
return flask.redirect(flask.url_for('metapackage_report', name=name))
if flask.request.remote_addr == 'XXX':
# notification for contributors submitting a lot of reports, substitude IP instead of XXX
# TODO: set address from config
flask.flash('Report for {} added successfully and will be processed in a few days, thank you! But hey, if you plan to submit report for all problems in your repository I probably won\'t be able to process these. Please consider submitting PRs to ruleset (preferrably i
n batches of 10 rules or so) instead.'.format(name), 'danger')
else:
flask.flash('Report for {} added successfully and will be processed in a few days, thank you!'.format(name), 'success')

return flask.redirect(flask.url_for('project_report', name=name))

return flask.render_template(
'project/report.html',
Expand Down

0 comments on commit 171176c

Please sign in to comment.