Skip to content

Commit

Permalink
Merge pull request #295 from CityOfNewYork/hotfix/OP-1360
Browse files Browse the repository at this point in the history
Hotfix/OP-1360: Fix Multiple Emails for Multi-File Uploads
  • Loading branch information
johnyu95 authored Jan 16, 2018
2 parents 0f15188 + f00cbc9 commit a5248ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/response/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ def send_file_email(request_id, release_public_links, release_private_links, pri
email_content_agency,
'File(s) Added to {}'.format(request_id),
bcc=bcc)
else:
elif private_links:
email_content_agency = email_content.replace(replace_string,
render_template('email_templates/response_file_links.html',
request_id=request_id,
Expand Down
24 changes: 12 additions & 12 deletions app/response/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ def response_file(request_id):
flash(message=response_obj, category='danger')
else:
get_file_links(response_obj, release_public_links, release_private_links, private_links)
send_file_email(request_id,
release_public_links,
release_private_links,
private_links,
flask_request.form['email-file-summary'],
flask_request.form['replace-string'],
flask_request.form['tz_name'])
send_file_email(request_id,
release_public_links,
release_private_links,
private_links,
flask_request.form['email-file-summary'],
flask_request.form['replace-string'],
flask_request.form['tz_name'])
return redirect(url_for('request.view', request_id=request_id))


Expand Down Expand Up @@ -605,11 +605,11 @@ def remove(resp):
# user is agency or is public and response is not private
if (((current_user.is_public and response_.privacy != PRIVATE)
or current_user.is_agency)
# user is associated with request
and UserRequests.query.filter_by(
request_id=response_.request_id,
user_guid=current_user.guid,
auth_user_type=current_user.auth_user_type
# user is associated with request
and UserRequests.query.filter_by(
request_id=response_.request_id,
user_guid=current_user.guid,
auth_user_type=current_user.auth_user_type
).first() is not None):
@after_this_request
def remove(resp):
Expand Down

0 comments on commit a5248ba

Please sign in to comment.