Don't check dictionaries blindly

This commit is contained in:
Roberto Rosario
2015-03-30 05:10:12 -04:00
parent b6855cc40e
commit 00569e9b6f
2 changed files with 2 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ def create_superuser_and_anonymous_user(sender, **kwargs):
Create our own admin super user automatically. Create our own admin super user automatically.
""" """
if kwargs['app'] == 'common': if kwargs.get('app') == 'common':
AutoAdminSingleton.objects.get_or_create() AutoAdminSingleton.objects.get_or_create()
AnonymousUserSingleton.objects.get_or_create() AnonymousUserSingleton.objects.get_or_create()

View File

@@ -16,7 +16,7 @@ from .models import Installation
def create_installation_instance(sender, **kwargs): def create_installation_instance(sender, **kwargs):
if kwargs['app'] == 'installation': if kwargs.get('app') == 'installation':
Installation.objects.get_or_create() Installation.objects.get_or_create()