Skip to content

Commit

Permalink
Remove doi approval view get_object method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tammo-Feldmann committed Nov 3, 2023
1 parent 4de306a commit cedbb51
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions app/admin_ui/views/doi.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,12 @@ class DoiApprovalView(NotificationSidebar, SingleObjectMixin, MultipleObjectMixi
template_name = "api_app/campaign_dois.html"
paginate_by = 10
campaign_queryset = Change.objects.of_type(Campaign)
pk_url_kwarg = "canonical_uuid"

def get(self, request, *args, **kwargs):
self.object = self.get_object(queryset=self.campaign_queryset)
return super().get(request, *args, **kwargs)

def get_object(self, queryset=None):
if not queryset:
queryset = self.queryset

canonical_uuid = self.kwargs["canonical_uuid"]

if obj := queryset.related_drafts(canonical_uuid).order_by('status').first():
return obj
raise Http404(f'No in progress draft with Canonical UUID {canonical_uuid!r}')

def get_queryset(self):
return (
Change.objects.of_type(DOI).filter(
Expand Down

0 comments on commit cedbb51

Please sign in to comment.