mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-18 15:57:44 +02:00
Fixed endpoint lookup using param query
This commit is contained in:
+12
-1
@@ -201,7 +201,18 @@ class EndPointViewSet(viewsets.ModelViewSet):
|
||||
def get_queryset(self):
|
||||
req = self.request
|
||||
url_of = req.query_params.get('url_of')
|
||||
if url_of:
|
||||
url_query = req.query_params.get('query_param')
|
||||
if url_query:
|
||||
if url_query.isnumeric():
|
||||
self.queryset = WayBackEndPoint.objects.filter(
|
||||
Q(
|
||||
url_of__domain_name__domain_name=url_query) | Q(
|
||||
http_url=url_query) | Q(
|
||||
id=url_query))
|
||||
else:
|
||||
self.queryset = WayBackEndPoint.objects.filter(
|
||||
Q(url_of__domain_name__domain_name=url_query) | Q(http_url=url_query))
|
||||
elif url_of:
|
||||
self.queryset = WayBackEndPoint.objects.filter(url_of__id=url_of)
|
||||
return self.queryset
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user