From 171176c3115dc5bd471f8b1c40dafa4a2386aa13 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 10 Apr 2024 16:51:14 +0300 Subject: [PATCH] Add placeholder to notify users submitting a log of reports --- repologyapp/views/project.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/repologyapp/views/project.py b/repologyapp/views/project.py index ceb5ec6d..7efd89e6 100644 --- a/repologyapp/views/project.py +++ b/repologyapp/views/project.py @@ -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',