Don't create an __init__.py file in the media folder. Replace error number literals with constant definitions.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-05-04 00:49:42 -04:00
parent 55359c72cf
commit ae9a519263

View File

@@ -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')