updating to event list serializer

This commit is contained in:
rizwanisready
2024-05-27 12:48:06 +05:30
parent 3cab0dbbc4
commit 496e8a3fba
4 changed files with 25 additions and 25 deletions

View File

@@ -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",
]

View File

@@ -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,

View File

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

View File

@@ -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;
});
});