Skip to content

Commit

Permalink
modernized argument parsing for settings command
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed May 29, 2017
1 parent 2476e4f commit 9800ac1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django_utils/management/commands/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ class Command(base_command.CustomBaseCommand):
can_import_settings = True
requires_model_validation = False

def add_argument(self, parser):
parser.add_argument('keys', nargs='+')

def handle(self, *args, **options):
from django.conf import settings
args = list(map(str.upper, args))
args = list(map(str.upper, options.get('keys', [])))
for k in dir(settings):
if k.upper() == k:
v = getattr(settings, k)
Expand Down

0 comments on commit 9800ac1

Please sign in to comment.