updating to event list serializer
This commit is contained in:
@@ -59,23 +59,23 @@ class EventListSerializer(serializers.ModelSerializer):
|
||||
"description",
|
||||
"start_date",
|
||||
"end_date",
|
||||
"from_time",
|
||||
"to_time",
|
||||
"category",
|
||||
"venue",
|
||||
"venue_capacity",
|
||||
# "from_time",
|
||||
# "to_time",
|
||||
# "category",
|
||||
# "venue",
|
||||
# "venue_capacity",
|
||||
"image",
|
||||
# "video_url",
|
||||
"entry_type",
|
||||
# "entry_type",
|
||||
"entry_fee",
|
||||
"key_guest",
|
||||
"age_group",
|
||||
# "key_guest",
|
||||
# "age_group",
|
||||
# "images",
|
||||
# "is_favorited",
|
||||
# "reviews",
|
||||
"tags",
|
||||
# "tags",
|
||||
# "principal_interaction",
|
||||
"draft",
|
||||
# "draft",
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -191,12 +191,12 @@ class EventsAPIView(APIView):
|
||||
events = services.EventFilterService.filter_events(
|
||||
filter_type=filter, principal=request.user
|
||||
)
|
||||
serializer = EventDetailSerializer(
|
||||
events, context={"request": request}, many=True
|
||||
)
|
||||
# serializer = EventListSerializer(
|
||||
# serializer = EventDetailSerializer(
|
||||
# events, context={"request": request}, many=True
|
||||
# )
|
||||
serializer = EventListSerializer(
|
||||
events, context={"request": request}, many=True
|
||||
)
|
||||
return ApiResponse.success(
|
||||
status=status.HTTP_200_OK,
|
||||
message=constants.SUCCESS,
|
||||
|
||||
@@ -427,11 +427,11 @@ def create_checkout_session(request):
|
||||
subscription_id = data.get("subscriptionId", None)
|
||||
principal_id = request.user.id
|
||||
|
||||
if has_active_principal_subscription(principal_id):
|
||||
print("Active principal subscription already exists.")
|
||||
return JsonResponse(
|
||||
{"error": "Active principal subscription already exists"}, status=400
|
||||
)
|
||||
# if has_active_principal_subscription(principal_id):
|
||||
# print("Active principal subscription already exists.")
|
||||
# return JsonResponse(
|
||||
# {"error": "Active principal subscription already exists"}, status=400
|
||||
# )
|
||||
|
||||
try:
|
||||
subscription = Subscription.objects.get(id=subscription_id)
|
||||
|
||||
@@ -547,12 +547,12 @@
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error:", error);
|
||||
const errorMessageElement = document.getElementById('already-active-subscription');
|
||||
if (errorMessageElement) {
|
||||
errorMessageElement.innerText = "Error: " + error.message; // Display the error in the specific div
|
||||
errorMessageElement.style.color = 'red'; // Set text color to red
|
||||
errorMessageElement.style.fontWeight = 'bold'; // Set text to bold
|
||||
}
|
||||
// const errorMessageElement = document.getElementById('already-active-subscription');
|
||||
// if (errorMessageElement) {
|
||||
// errorMessageElement.innerText = "Error: " + error.message; // Display the error in the specific div
|
||||
// errorMessageElement.style.color = 'red'; // Set text color to red
|
||||
// errorMessageElement.style.fontWeight = 'bold'; // Set text to bold
|
||||
// }
|
||||
button.disabled = false;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user