Skip to content

Commit 73695b4

Browse files
stsewdericholscher
authored andcommitted
Workaround HttpExchange queries casting IDs as uuid/int wrongly
1 parent dea100a commit 73695b4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

readthedocs/projects/views/private.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,9 @@ class WebHookExchangeDetail(WebHookMixin, DetailView):
632632
template_name = 'projects/webhook_exchange_detail.html'
633633

634634
def get_queryset(self):
635-
return self.model.objects.filter(webhook=self.get_webhook())
635+
# NOTE: We are explicitly using the id instead of the the object
636+
# to avoid a bug where the id is wrongly casted as an uuid.
637+
return self.model.objects.filter(webhook__id=self.get_webhook().id)
636638

637639
def get_webhook(self):
638640
return get_object_or_404(
@@ -916,7 +918,9 @@ class IntegrationExchangeDetail(IntegrationMixin, DetailView):
916918
template_name = 'projects/integration_exchange_detail.html'
917919

918920
def get_queryset(self):
919-
return self.model.objects.filter(integrations=self.get_integration())
921+
# NOTE: We are explicitly using the id instead of the the object
922+
# to avoid a bug where the id is wrongly casted as an uuid.
923+
return self.model.objects.filter(integrations__id=self.get_integration().id)
920924

921925
def get_object(self):
922926
return DetailView.get_object(self)

0 commit comments

Comments
 (0)