mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 05:11:09 -05:00
Add comprehensive API documentation for ThrillWiki integration and features
- Introduced Next.js integration guide for ThrillWiki API, detailing authentication, core domain APIs, data structures, and implementation patterns. - Documented the migration to Rich Choice Objects, highlighting changes for frontend developers and enhanced metadata availability. - Fixed the missing `get_by_slug` method in the Ride model, ensuring proper functionality of ride detail endpoints. - Created a test script to verify manufacturer syncing with ride models, ensuring data integrity across related models.
This commit is contained in:
@@ -127,8 +127,13 @@ class ModerationReportSerializer(serializers.ModelSerializer):
|
||||
|
||||
# Define SLA hours by priority
|
||||
sla_hours = {"URGENT": 2, "HIGH": 8, "MEDIUM": 24, "LOW": 72}
|
||||
|
||||
if obj.priority in sla_hours:
|
||||
threshold = sla_hours[obj.priority]
|
||||
else:
|
||||
raise ValueError(f"Unknown priority level: {obj.priority}")
|
||||
|
||||
return hours_since_created > sla_hours.get(obj.priority, 24)
|
||||
return hours_since_created > threshold
|
||||
|
||||
def get_time_since_created(self, obj) -> str:
|
||||
"""Human-readable time since creation."""
|
||||
@@ -345,12 +350,12 @@ class CompleteQueueItemSerializer(serializers.Serializer):
|
||||
|
||||
action = serializers.ChoiceField(
|
||||
choices=[
|
||||
"NO_ACTION",
|
||||
"CONTENT_REMOVED",
|
||||
"CONTENT_EDITED",
|
||||
"USER_WARNING",
|
||||
"USER_SUSPENDED",
|
||||
"USER_BANNED",
|
||||
("NO_ACTION", "No Action Required"),
|
||||
("CONTENT_REMOVED", "Content Removed"),
|
||||
("CONTENT_EDITED", "Content Edited"),
|
||||
("USER_WARNING", "User Warning Issued"),
|
||||
("USER_SUSPENDED", "User Suspended"),
|
||||
("USER_BANNED", "User Banned"),
|
||||
]
|
||||
)
|
||||
notes = serializers.CharField(required=False, allow_blank=True)
|
||||
@@ -722,7 +727,14 @@ class UserModerationProfileSerializer(serializers.Serializer):
|
||||
active_restrictions = serializers.IntegerField()
|
||||
|
||||
# Risk assessment
|
||||
risk_level = serializers.ChoiceField(choices=["LOW", "MEDIUM", "HIGH", "CRITICAL"])
|
||||
risk_level = serializers.ChoiceField(
|
||||
choices=[
|
||||
("LOW", "Low Risk"),
|
||||
("MEDIUM", "Medium Risk"),
|
||||
("HIGH", "High Risk"),
|
||||
("CRITICAL", "Critical Risk"),
|
||||
]
|
||||
)
|
||||
risk_factors = serializers.ListField(child=serializers.CharField())
|
||||
|
||||
# Recent activity
|
||||
|
||||
Reference in New Issue
Block a user