mirror of
https://github.com/boostorg/website-v2.git
synced 2026-02-27 17:42:08 +00:00
Fix merge
This commit is contained in:
@@ -53,6 +53,21 @@ class LibraryDetail(CategoryMixin, DetailView):
|
||||
model = Library
|
||||
template_name = "libraries/detail.html"
|
||||
|
||||
def get_object(self):
|
||||
slug = self.kwargs.get("slug")
|
||||
version = Version.objects.most_recent()
|
||||
|
||||
if not LibraryVersion.objects.filter(
|
||||
version=version, library__slug=slug
|
||||
).exists():
|
||||
raise Http404("No library found matching the query")
|
||||
|
||||
try:
|
||||
obj = self.get_queryset().get(slug=slug)
|
||||
except queryset.model.DoesNotExist:
|
||||
raise Http404("No library found matching the query")
|
||||
return obj
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
context = self.get_context_data(object=self.object)
|
||||
|
||||
Reference in New Issue
Block a user