Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions templates/store/snap-details/_report_snap_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ <h5 class="p-notification__title">

<label for="report-snap-email">Your email (optional)</label>
<input id="report-snap-email" type="email" name="email" placeholder="email@example.com" />
<div class="u-off-screen">
<label for="report-snap-confirm" aria-hidden="true">I agree</label>
<input id="report-snap-confirm" type="checkbox" name="confirm" aria-hidden="true" />
</div>
<p>In submitting this form, I confirm that I have read and agree to <a href="https://ubuntu.com/legal/data-privacy/contact">Canonical’s Privacy Notice</a> and <a href="https://ubuntu.com/legal/data-privacy">Privacy Policy</a>.</p>
<div class="u-align--right">
<button type="button" class="js-modal-close u-no-margin--bottom">Cancel</button>
Expand Down
4 changes: 4 additions & 0 deletions webapp/store/snap_details_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ def report_snap():

fields = flask.request.form

# If the honeypot is activated (hidden field populated
# silently reject to avoid spam
if "confirm" in fields:
return flask.jsonify({"ok": True}), 200
payload = {
"snap_name": fields.get("snap_name", ""),
"reason": fields.get("reason", ""),
Expand Down