From 12b8ed02fdd84d4ff38e37a7ccc46c9c4ec30c9f Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 1 Sep 2024 16:47:33 +0800 Subject: [PATCH] Fix unused admin credentials in .env file --- .env.sample | 7 ++----- backend/accounts/signals.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.env.sample b/.env.sample index a8e0106..6daa4bf 100644 --- a/.env.sample +++ b/.env.sample @@ -5,14 +5,11 @@ SECRET_KEY = '' # Production Switches BACKEND_DEBUG = 'True' -# Superuser Credentials -DJANGO_ADMIN_USERNAME = 'admin' -DJANGO_ADMIN_EMAIL = 'admin@drf-template.com' -DJANGO_ADMIN_PASSWORD = '' - # Seed Data Credentials +# Username and emails can be found in seed_data.json SEED_DATA = 'True' SEED_DATA_PASSWORD = '12345' +SEED_DATA_ADMIN_PASSWORD = '' # Email Credentials EMAIL_HOST = 'inbucket' diff --git a/backend/accounts/signals.py b/backend/accounts/signals.py index 14512a2..7e29149 100644 --- a/backend/accounts/signals.py +++ b/backend/accounts/signals.py @@ -21,7 +21,7 @@ def create_users(sender, **kwargs): if user['password'] == 'USE_REGULAR': password = get_secret('SEED_DATA_PASSWORD') elif user['password'] == 'USE_ADMIN': - password = get_secret('DJANGO_ADMIN_PASSWORD') + password = get_secret('SEED_DATA_ADMIN_PASSWORD') else: password = user['password'] if (user['is_superuser'] == True):