mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 19:11:08 -05:00
Add migrations for ParkPhoto and RidePhoto models with associated events
- Created ParkPhoto and ParkPhotoEvent models in the parks app, including fields for image, caption, alt text, and relationships to the Park model. - Implemented triggers for insert and update operations on ParkPhoto to log changes in ParkPhotoEvent. - Created RidePhoto and RidePhotoEvent models in the rides app, with similar structure and functionality as ParkPhoto. - Added fields for photo type in RidePhoto and implemented corresponding triggers for logging changes. - Established necessary indexes and unique constraints for both models to ensure data integrity and optimize queries.
This commit is contained in:
@@ -86,17 +86,14 @@ class Command(BaseCommand):
|
||||
else:
|
||||
self.stdout.write(
|
||||
self.style.WARNING(
|
||||
f"Registration returned status {
|
||||
response.status_code}: {
|
||||
response.content.decode()}\n"
|
||||
f"Registration returned status {response.status_code}: {
|
||||
response.content.decode()
|
||||
}\n"
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"Registration email test failed: {
|
||||
str(e)}\n"
|
||||
)
|
||||
self.style.ERROR(f"Registration email test failed: {str(e)}\n")
|
||||
)
|
||||
|
||||
def test_password_change(self, user):
|
||||
@@ -120,17 +117,14 @@ class Command(BaseCommand):
|
||||
else:
|
||||
self.stdout.write(
|
||||
self.style.WARNING(
|
||||
f"Password change returned status {
|
||||
response.status_code}: {
|
||||
response.content.decode()}\n"
|
||||
f"Password change returned status {response.status_code}: {
|
||||
response.content.decode()
|
||||
}\n"
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"Password change email test failed: {
|
||||
str(e)}\n"
|
||||
)
|
||||
self.style.ERROR(f"Password change email test failed: {str(e)}\n")
|
||||
)
|
||||
|
||||
def test_email_change(self, user):
|
||||
@@ -151,17 +145,14 @@ class Command(BaseCommand):
|
||||
else:
|
||||
self.stdout.write(
|
||||
self.style.WARNING(
|
||||
f"Email change returned status {
|
||||
response.status_code}: {
|
||||
response.content.decode()}\n"
|
||||
f"Email change returned status {response.status_code}: {
|
||||
response.content.decode()
|
||||
}\n"
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"Email change verification test failed: {
|
||||
str(e)}\n"
|
||||
)
|
||||
self.style.ERROR(f"Email change verification test failed: {str(e)}\n")
|
||||
)
|
||||
|
||||
def test_password_reset(self, user):
|
||||
@@ -182,15 +173,12 @@ class Command(BaseCommand):
|
||||
else:
|
||||
self.stdout.write(
|
||||
self.style.WARNING(
|
||||
f"Password reset returned status {
|
||||
response.status_code}: {
|
||||
response.content.decode()}\n"
|
||||
f"Password reset returned status {response.status_code}: {
|
||||
response.content.decode()
|
||||
}\n"
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"Password reset email test failed: {
|
||||
str(e)}\n"
|
||||
)
|
||||
self.style.ERROR(f"Password reset email test failed: {str(e)}\n")
|
||||
)
|
||||
|
||||
@@ -84,7 +84,7 @@ class Command(BaseCommand):
|
||||
self.stdout.write(self.style.SUCCESS("Using configuration:"))
|
||||
self.stdout.write(f" From: {from_email}")
|
||||
self.stdout.write(f" To: {to_email}")
|
||||
self.stdout.write(f' API Key: {"*" * len(api_key)}')
|
||||
self.stdout.write(f" API Key: {'*' * len(api_key)}")
|
||||
self.stdout.write(f" Site: {site.domain}")
|
||||
|
||||
try:
|
||||
@@ -132,10 +132,7 @@ class Command(BaseCommand):
|
||||
return config
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"✗ Site configuration failed: {
|
||||
str(e)}"
|
||||
)
|
||||
self.style.ERROR(f"✗ Site configuration failed: {str(e)}")
|
||||
)
|
||||
raise
|
||||
|
||||
@@ -164,8 +161,8 @@ class Command(BaseCommand):
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"✗ API endpoint test failed with status {
|
||||
response.status_code}: {
|
||||
response.text}"
|
||||
response.status_code
|
||||
}: {response.text}"
|
||||
)
|
||||
)
|
||||
raise Exception(f"API test failed: {response.text}")
|
||||
@@ -178,12 +175,7 @@ class Command(BaseCommand):
|
||||
)
|
||||
raise Exception("Could not connect to Django server")
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"✗ API endpoint test failed: {
|
||||
str(e)}"
|
||||
)
|
||||
)
|
||||
self.stdout.write(self.style.ERROR(f"✗ API endpoint test failed: {str(e)}"))
|
||||
raise
|
||||
|
||||
def test_email_backend(self, to_email, site):
|
||||
@@ -196,8 +188,7 @@ class Command(BaseCommand):
|
||||
|
||||
# Debug output
|
||||
self.stdout.write(
|
||||
f" Debug: Using from_email: {
|
||||
site.email_config.default_from_email}"
|
||||
f" Debug: Using from_email: {site.email_config.default_from_email}"
|
||||
)
|
||||
self.stdout.write(f" Debug: Using to_email: {to_email}")
|
||||
|
||||
@@ -212,10 +203,7 @@ class Command(BaseCommand):
|
||||
self.stdout.write(self.style.SUCCESS("✓ Email backend test successful"))
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"✗ Email backend test failed: {
|
||||
str(e)}"
|
||||
)
|
||||
self.style.ERROR(f"✗ Email backend test failed: {str(e)}")
|
||||
)
|
||||
raise
|
||||
|
||||
@@ -236,9 +224,6 @@ class Command(BaseCommand):
|
||||
return response
|
||||
except Exception as e:
|
||||
self.stdout.write(
|
||||
self.style.ERROR(
|
||||
f"✗ Direct EmailService test failed: {
|
||||
str(e)}"
|
||||
)
|
||||
self.style.ERROR(f"✗ Direct EmailService test failed: {str(e)}")
|
||||
)
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user