Skip to content

Commit

Permalink
Merge pull request #568 from CityOfNewYork/johnyu95-remove-agency-rec…
Browse files Browse the repository at this point in the history
…aptcha

Remove Agency Recaptcha
  • Loading branch information
johnyu95 authored Oct 31, 2023
2 parents 547020c + 9311867 commit bde8d95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def status():
@main.route('/technical-support', methods=['GET', 'POST'])
def technical_support():
if request.method == 'POST':
if current_app.config['RECAPTCHA_ENABLED']:
if current_app.config['RECAPTCHA_ENABLED'] and not current_user.is_agency:
try:
# Verify recaptcha token and return error if failed
recaptcha_response = requests.post(
Expand Down
2 changes: 1 addition & 1 deletion app/request/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def new():
new_request_template = "request/new_request_" + template_suffix

if flask_request.method == "POST":
if current_app.config['RECAPTCHA_ENABLED']:
if current_app.config['RECAPTCHA_ENABLED'] and not current_user.is_agency:
try:
# Verify recaptcha token and return error if failed
recaptcha_response = requests.post(
Expand Down
2 changes: 1 addition & 1 deletion app/templates/main/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1 class="text-center">Technical Support</h1>
<p id="message-character-count" class="character-counter">5000 characters remaining</p>

<br>
{% if config['RECAPTCHA_ENABLED'] %}
{% if config['RECAPTCHA_ENABLED'] and not current_user.is_agency %}
<input id="send"
name="send"
type="submit"
Expand Down
13 changes: 1 addition & 12 deletions app/templates/request/new_request_agency.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,7 @@ <h3>Address</h3>
placeholder="12345") }}<br>
</div>
<input type="hidden" name="tz-name">
{% if config['RECAPTCHA_ENABLED'] %}
<input id="submit"
class="g-recaptcha btn-primary"
value="Submit Request"
aria-label="Submit request button"
type="submit"
data-sitekey='{{ config['RECAPTCHA_PUBLIC_KEY'] }}'
data-callback='onSubmitRequest'
data-action='newRequestAgency'>
{% else %}
{{ form.submit(id="submit", class="btn-primary") }}
{% endif %}
{{ form.submit(id="submit", class="btn-primary") }}
{% include "request/_pii_warning_modal.html" %}
<span id="processing-submission" hidden>
<img src="{{ url_for("static", filename="img/loading.gif") }}"
Expand Down

0 comments on commit bde8d95

Please sign in to comment.