feat: Implement initial schema and add various API, service, and management command enhancements across the application.

This commit is contained in:
pacnpal
2026-01-01 15:13:01 -05:00
parent c95f99ca10
commit b243b17af7
413 changed files with 11164 additions and 17433 deletions

View File

@@ -37,9 +37,7 @@ class Command(BaseCommand):
identifier = photo.park.slug
# Look for any files in that directory
old_dir = os.path.join(
settings.MEDIA_ROOT, content_type, identifier
)
old_dir = os.path.join(settings.MEDIA_ROOT, content_type, identifier)
if os.path.exists(old_dir):
files = [
f
@@ -83,9 +81,7 @@ class Command(BaseCommand):
# Move the file
if current_path != new_full_path:
shutil.copy2(
current_path, new_full_path
) # Use copy2 to preserve metadata
shutil.copy2(current_path, new_full_path) # Use copy2 to preserve metadata
processed_files.add(current_path)
else:
processed_files.add(current_path)
@@ -116,9 +112,7 @@ class Command(BaseCommand):
identifier = parts[1] # e.g., 'alton-towers'
# Look for any files in that directory
old_dir = os.path.join(
settings.MEDIA_ROOT, content_type, identifier
)
old_dir = os.path.join(settings.MEDIA_ROOT, content_type, identifier)
if os.path.exists(old_dir):
files = [
f
@@ -162,9 +156,7 @@ class Command(BaseCommand):
# Move the file
if current_path != new_full_path:
shutil.copy2(
current_path, new_full_path
) # Use copy2 to preserve metadata
shutil.copy2(current_path, new_full_path) # Use copy2 to preserve metadata
processed_files.add(current_path)
else:
processed_files.add(current_path)
@@ -192,8 +184,6 @@ class Command(BaseCommand):
os.remove(file_path)
self.stdout.write(f"Removed old file: {file_path}")
except Exception as e:
self.stdout.write(
f"Error removing {file_path}: {str(e)}"
)
self.stdout.write(f"Error removing {file_path}: {str(e)}")
self.stdout.write("Finished moving photo files and cleaning up")