Skip to content

Commit

Permalink
Issue #3121 - Disable anonymous reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Jan 3, 2020
1 parent 40b83fa commit 524e130
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 40 deletions.
2 changes: 1 addition & 1 deletion webcompat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def is_valid_issue_form(form):
'submit_type',
'url',
'username', ]
form_submit_values = ['github-auth-report', 'github-proxy-report']
form_submit_values = ['github-auth-report']
parameters_check = set(must_parameters).issubset(list(form.keys()))
if parameters_check:
values_check = form['submit_type'] in form_submit_values
Expand Down
10 changes: 6 additions & 4 deletions webcompat/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ def report_issue(form, proxy=False):
submit_type = form.get('submit_type')
if proxy and submit_type == 'github-proxy-report':
# Return a Response object.
response = proxy_request('post',
path,
data=json.dumps(build_formdata(form)))
json_response = response.json()
# response = proxy_request('post',
# path,
# data=json.dumps(build_formdata(form)))
# json_response = response.json()
# Anonymous reporting is currently disabled.
abort(400)
elif (not proxy) and submit_type == 'github-auth-report':
# Return JSON data as a dict
json_response = github.post(path, build_formdata(form))
Expand Down
9 changes: 4 additions & 5 deletions webcompat/templates/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,11 @@ <h1 class="headline-1">Report Site Issue</h1>
<div class="form-button form-button-multiple form-element js-Form-group js-report-buttons">
<div class="button-wrapper js-Button-wrapper">
<button
class="button button-secondary js-Button"
id="submitanon"
type="submit"
name="github-proxy-report"
class="button button-secondary"
type="button"
disabled="disabled"
>
Report Anonymously
Anonymous reports temporarily disabled
</button>
</div>
<div class="button-wrapper js-Button-wrapper">
Expand Down
41 changes: 11 additions & 30 deletions webcompat/templates/issue-wizard-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,45 +324,26 @@ <h3 class="page-heading">Filing a web compatibility issue</h3>
<div class="input-control">
<div class="col center">
<div class="final-text">
Good job! You can&nbsp;<strong>report via GitHub</strong>&nbsp;or&nbsp;<strong>report anonymously</strong>.
Good job! You can&nbsp;<strong>report via GitHub</strong>
<div><strong>Anonymous reporting is temporarily disabled</strong>.</div>
</div>
<div class="row mobile-col">
<button class="button button-secondary right js-Button" id="submitgithub" type="submit" name="github-auth-report">
<img class="" src="{{ url_for('static', filename='img/svg/icons/svg-github-white.svg') }}" title="Report via GitHub" alt="Report via GitHub" />
{% if session.username %}Report as {{ session.username }}{% else %}Report via GitHub{% endif %}
</button>
<button class="button button-primary" id="open-username" type="submit">
Report Anonymously
</button>
</div>
<div class="optional-username centered low">
You can optionally provide your GitHub username, allowing us to contact you during diagnosis.
<div class="column narrow js-Form-group">
<div class="label">
<label class="form-label" for="contact">Optional GitHub username</label>
<div class="right-label">public</div>
</div>
{{ form.contact(class_='form-field text-field',
placeholder='GitHub username',
pattern='^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$') }}

<div class="is-hidden" aria-hidden="true">
<div class="form-text form-element js-Form-group">
{{ form.username.label(class_='form-label') }}
{% if form.username.errors %}
{% for error in form.username.errors %}
<small class="form-message-error">{{ error }}</small>
{% endfor %}
{% endif %}
{{ form.username(class_='u-formInput') }}
</div>
<div class="is-hidden" aria-hidden="true">
<div class="form-text form-element js-Form-group">
{{ form.username.label(class_='form-label') }}
{% if form.username.errors %}
{% for error in form.username.errors %}
<small class="form-message-error">{{ error }}</small>
{% endfor %}
{% endif %}
{{ form.username(class_='u-formInput') }}
</div>
</div>
<div class="col center">
<button class="button button-primary js-Button" id="submitanon" type="submit" name="github-proxy-report">
Send report
</button>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 524e130

Please sign in to comment.