Multi-platform: support multiple files per version #201
@ -27,18 +27,13 @@ class ExtensionQuerysetMixin:
|
||||
|
||||
|
||||
class MaintainedExtensionMixin:
|
||||
"""Fetch an extension by slug if current user is a maintainer.
|
||||
|
||||
If pk is present, also fetch a corresponding version.
|
||||
"""
|
||||
"""Fetch an extension by slug if current user is a maintainer."""
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
self.extension = get_object_or_404(
|
||||
Extension.objects.authored_by(self.request.user),
|
||||
slug=self.kwargs['slug'],
|
||||
)
|
||||
if 'pk' in self.kwargs:
|
||||
self.version = get_object_or_404(self.extension.versions, pk=self.kwargs['pk'])
|
||||
return super().dispatch(*args, **kwargs)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user