forked from pinax/django-mailer
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
The Django 1.8.3 security update introduces a backport (django/django@76c526f) which casts the verbosity argument to an int.
This results in the error:
File ".../django-mailer/django_mailer/management/commands/__init__.py", line 13, in create_handler
handler.setLevel(LOGGING_LEVEL[verbosity])
KeyError: 1
In my fork I just needed to change LOGGING_LEVEL in https://github.com/SmileyChris/django-mailer-2/blob/master/django_mailer/management/commands/__init__.py#L4 from:
LOGGING_LEVEL = {'0': logging.ERROR, '1': logging.WARNING, '2': logging.DEBUG}
to:
LOGGING_LEVEL = {0: logging.ERROR, 1: logging.WARNING, 2: logging.DEBUG}
because I don't need to maintain backwards compatibility with earlier Django versions.
A backwards compatible fix in this source repo would need either a version check to set LOGGING_LEVEL appropriately or a try-catch in create_handler to cast if there's a KeyError.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels