-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #629 from hms-dbmi/development
Development
- Loading branch information
Showing
18 changed files
with
531 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,8 +135,8 @@ | |
SSL_SETTING = "https" | ||
VERIFY_REQUESTS = True | ||
|
||
CONTACT_FORM_RECIPIENTS="[email protected]" | ||
DEFAULT_FROM_EMAIL="[email protected]" | ||
# Pass a list of email addresses | ||
CONTACT_FORM_RECIPIENTS = environment.get_list('CONTACT_FORM_RECIPIENTS', required=True) | ||
|
||
RECAPTCHA_KEY = environment.get_str('RECAPTCHA_KEY', required=True) | ||
RECAPTCHA_CLIENT_ID = environment.get_str('RECAPTCHA_CLIENT_ID', required=True) | ||
|
@@ -146,6 +146,7 @@ | |
S3_BUCKET = environment.get_str('S3_BUCKET', required=True) | ||
|
||
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' | ||
AWS_S3_SIGNATURE_VERSION = 's3v4' | ||
AWS_STORAGE_BUCKET_NAME = environment.get_str('S3_BUCKET', required=True) | ||
AWS_LOCATION = 'upload' | ||
|
||
|
@@ -240,21 +241,29 @@ | |
|
||
# Determine email backend | ||
EMAIL_BACKEND = environment.get_str("EMAIL_BACKEND", required=True) | ||
if EMAIL_BACKEND == "django.core.mail.backends.smtp.EmailBackend": | ||
|
||
# SMTP Email configuration | ||
EMAIL_SMTP = EMAIL_BACKEND == "django.core.mail.backends.smtp.EmailBackend" | ||
EMAIL_USE_SSL = environment.get_bool("EMAIL_USE_SSL", default=EMAIL_SMTP) | ||
EMAIL_HOST = environment.get_str("EMAIL_HOST", required=EMAIL_SMTP) | ||
EMAIL_HOST_USER = environment.get_str("EMAIL_HOST_USER", required=False) | ||
EMAIL_HOST_PASSWORD = environment.get_str("EMAIL_HOST_PASSWORD", required=False) | ||
EMAIL_PORT = environment.get_str("EMAIL_PORT", required=EMAIL_SMTP) | ||
|
||
# AWS SES Email configuration | ||
EMAIL_SES = EMAIL_BACKEND == "django_ses.SESBackend" | ||
AWS_SES_SOURCE_ARN=environment.get_str("DBMI_SES_IDENTITY", required=EMAIL_SES) | ||
AWS_SES_FROM_ARN=environment.get_str("DBMI_SES_IDENTITY", required=EMAIL_SES) | ||
AWS_SES_RETURN_PATH_ARN=environment.get_str("DBMI_SES_IDENTITY", required=EMAIL_SES) | ||
USE_SES_V2 = True | ||
# SMTP Email configuration | ||
EMAIL_USE_SSL = environment.get_bool("EMAIL_USE_SSL", default=True) | ||
EMAIL_HOST = environment.get_str("EMAIL_HOST", required=True) | ||
EMAIL_HOST_USER = environment.get_str("EMAIL_HOST_USER", required=False) | ||
EMAIL_HOST_PASSWORD = environment.get_str("EMAIL_HOST_PASSWORD", required=False) | ||
EMAIL_PORT = environment.get_str("EMAIL_PORT", required=True) | ||
|
||
elif EMAIL_BACKEND == "django_ses.SESBackend": | ||
|
||
# AWS SES Email configuration | ||
AWS_SES_SOURCE_ARN = environment.get_str("DBMI_SES_IDENTITY", required=True) | ||
AWS_SES_FROM_ARN = environment.get_str("DBMI_SES_IDENTITY", required=True) | ||
AWS_SES_RETURN_PATH_ARN = environment.get_str("DBMI_SES_IDENTITY", required=True) | ||
USE_SES_V2 = True | ||
|
||
else: | ||
raise SystemError(f"Email backend '{EMAIL_BACKEND}' is not supported for this application") | ||
|
||
# Set default from address | ||
EMAIL_FROM_ADDRESS = environment.get_str("EMAIL_FROM_ADDRESS", required=True) | ||
EMAIL_REPLY_TO_ADDRESS = environment.get_str("EMAIL_REPLY_TO_ADDRESS", default=EMAIL_FROM_ADDRESS) | ||
|
||
##################################################################################### | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.4 on 2023-09-12 16:20 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('projects', '0101_challengetask_submission_instructions'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='agreementform', | ||
name='skippable', | ||
field=models.BooleanField(default=False, help_text='Allow participants to skip this step in instances where they have submitted the agreement form via email or some other means. They will be required to include the name and contact information of the person who they submitted their signed agreement form to.'), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
app/projects/migrations/0103_dataproject_commercial_only.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.1 on 2023-06-28 10:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('projects', '0102_agreementform_skippable'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='dataproject', | ||
name='commercial_only', | ||
field=models.BooleanField(default=False, help_text='Commercial only projects are for commercial entities only'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
/** | ||
* Finds all 'button' elements contained in a form and toggles their 'disabled' proeprty. | ||
* @param {String} formSelector The jQuery selector of the form to disable buttons for. | ||
*/ | ||
function toggleFormButtons(formSelector) { | ||
|
||
// Toggle disabled state of all buttons in form | ||
$(formSelector).find("button").each(function() { | ||
$(this).prop("disabled", !$(this).prop("disabled")); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/templates/manage/upload-signed-agreement-form-file.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% load bootstrap3 %} | ||
|
||
<form id="upload-signed-agreement-form-file-form" class="file-upload-form" method="post" enctype="multipart/form-data" | ||
ic-post-to="{% url 'manage:upload-signed-agreement-form-file' signed_agreement_form_id %}" | ||
ic-on-beforeSend="toggleFormButtons('#upload-signed-agreement-form-file-form')" | ||
ic-on-complete="toggleFormButtons('#upload-signed-agreement-form-file-form')"> | ||
<div class="modal-header modal-header-primary"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
<h3 class="modal-title">Signed Agreement Form File Upload</h3> | ||
</div> | ||
<div class="modal-body"> | ||
{% csrf_token %} | ||
{% bootstrap_form form inline=True %} | ||
</div> | ||
<div class="modal-footer"> | ||
{% buttons %} | ||
<button id="file-upload-close-button" type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
<button id="file-upload-submit-button" type="submit" class="btn btn-primary">Submit | ||
<span id="file-upload-form-indicator" style="display: none; margin-left: 5px;" class="ic-indicator fa fa-spinner fa-spin"></span> | ||
</button> | ||
{% endbuttons %} | ||
</div> | ||
</form> |
Oops, something went wrong.