From da8f7b1633519be1a2dfe4b90de9ca15584743a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Thu, 30 Jul 2020 00:12:02 +0200 Subject: [PATCH] ipfs view searches through all links now --- sdbs_pile/pile/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdbs_pile/pile/views.py b/sdbs_pile/pile/views.py index 12d78aa..216d880 100644 --- a/sdbs_pile/pile/views.py +++ b/sdbs_pile/pile/views.py @@ -179,6 +179,7 @@ def ExternalLinkView(request: HttpRequest): def IPFSView(request: HttpRequest): - ipfs_matches = [re.search(r'Qm[\w]{44}', doc.url) for doc in Document.objects.all() if 'ipfs' in doc.url] + ipfs_matches = [re.search(r'Qm[\w]{44}', link.url) + for link in DocumentLink.objects.order_by('order', '-document_id') if 'ipfs' in link.url] ipfs_cids = [match.group(0) for match in ipfs_matches if match] return HttpResponse("\n".join(ipfs_cids), content_type='text/plain')