-
Notifications
You must be signed in to change notification settings - Fork 2
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 #173 from USEPA/fix_response_request_form
use group endpoint with paginator
- Loading branch information
Showing
11 changed files
with
121 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = os.environ.get('SECRET_KEY') | ||
SECRET_KEY = os.environ.get('SECRET_KEY', 'sssssh-its-a-secret') | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = os.environ.get('DEBUG') == 'True' | ||
|
@@ -193,14 +193,16 @@ | |
EMAIL_HOST = os.environ.get('EMAIL_HOST', 'localhost') | ||
EMAIL_FROM = os.environ.get('EMAIL_FROM', '[email protected]') | ||
|
||
ADMINS = json.loads(os.environ.get('ADMINS', '[]')) | ||
SERVER_EMAIL = "[email protected]" | ||
|
||
LOGGING = DEFAULT_LOGGING | ||
|
||
LOGGING['handlers']['slack'] = { | ||
LOGGING['handlers']['mail_admins'] = { | ||
'level': 'ERROR', | ||
'filters': ['require_debug_false'], | ||
'class': 'slack_logging.SlackExceptionHandler', | ||
'bot_token': os.environ.get('SLACK_BOT_TOKEN', ''), | ||
'channel_id': os.environ.get('SLACK_CHANNEL', '') | ||
"class": "django.utils.log.AdminEmailHandler", | ||
"include_html": False, | ||
} | ||
|
||
LOGGING['handlers']['file'] = { | ||
|
@@ -211,7 +213,7 @@ | |
} | ||
|
||
LOGGING['loggers']['django'] = { | ||
'handlers': ['console', 'slack', 'file'], | ||
'handlers': ['console', 'mail_admins', 'file'], | ||
'level': 'INFO', | ||
} | ||
|
||
|
32 changes: 32 additions & 0 deletions
32
accounts/migrations/0032_alter_responseproject_protected_datasets.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,32 @@ | ||
# Generated by Django 4.2.16 on 2024-09-10 20:20 | ||
from django.core.exceptions import ObjectDoesNotExist | ||
from django.db import migrations, models | ||
|
||
def set_auth_groups_for_roles(apps, schema_editor): | ||
AGOLRole = apps.get_model('accounts', 'AGOLRole') | ||
AGOLGroup = apps.get_model('accounts', 'AGOLGroup') | ||
try: | ||
r = AGOLRole.objects.get(pk=11) | ||
if r.auth_groups.count() == 0: | ||
groups = AGOLGroup.objects.filter(agol_id=1, is_auth_group=True).exclude(id='75a06d76-49b2-426f-b2a8-92f26fc5d1d1') | ||
r.auth_groups.set(groups) | ||
except ObjectDoesNotExist: | ||
pass | ||
|
||
try: | ||
r = AGOLRole.objects.get(pk=12) | ||
if r.auth_groups.count() == 0: | ||
groups = AGOLGroup.objects.filter(id='75a06d76-49b2-426f-b2a8-92f26fc5d1d1') | ||
r.auth_groups.set(groups) | ||
except ObjectDoesNotExist: | ||
pass | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('accounts', '0031_protecteddataset_alter_accountrequests_username_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(set_auth_groups_for_roles, migrations.RunPython.noop) | ||
] |
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
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
Oops, something went wrong.