From ae9a519263938652e8696a9124a37fad47347202 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 4 May 2018 00:49:42 -0400 Subject: [PATCH] Don't create an __init__.py file in the media folder. Replace error number literals with constant definitions. Signed-off-by: Roberto Rosario --- mayan/apps/common/management/commands/initialsetup.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mayan/apps/common/management/commands/initialsetup.py b/mayan/apps/common/management/commands/initialsetup.py index e89c6609ed..10afb5e39e 100644 --- a/mayan/apps/common/management/commands/initialsetup.py +++ b/mayan/apps/common/management/commands/initialsetup.py @@ -40,14 +40,11 @@ class Command(management.BaseCommand): if exception.errno == errno.EEXIST and force: pass - # Touch media/__init__.py - Command.touch(os.path.join(settings.MEDIA_ROOT, '__init__.py')) - # Create media/settings try: os.makedirs(settings_path) except OSError as exception: - if exception.errno == 17 and force: + if exception.errno == errno.EEXIST and force: pass # Touch media/settings/__init__.py @@ -57,7 +54,7 @@ class Command(management.BaseCommand): try: os.makedirs(system_path) except OSError as exception: - if exception.errno == 17 and force: + if exception.errno == errno.EEXIST and force: pass version_file_path = os.path.join(system_path, 'VERSION')