Skip to content

Commit

Permalink
Change historical detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
Tammo-Feldmann committed Nov 15, 2023
1 parent 1b9f24e commit 70408ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/admin_ui/views/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,17 @@ class HistoryDetailView(ModelObjectView):
def get_model_form_content_type(self) -> ContentType:
return Change.objects.get(uuid=self.kwargs[self.pk_url_kwarg]).content_type

def get_object(self):
return Change.objects.get(uuid=self.kwargs['draft_uuid'])

def get_context_data(self, **kwargs):
return {
**super().get_context_data(**kwargs),
"model_form": self._get_form(instance=kwargs.get("object"), disable_all=True),
"model_form": self._get_form(initial=kwargs.get("object").update, disable_all=True),
"view_model": (
Change.objects.get(uuid=self.kwargs[self.pk_url_kwarg]).model_name.lower()
),
"object": Change.objects.get(uuid=self.kwargs[self.pk_url_kwarg]),
"object": kwargs.get("object"),
"display_name": Change.objects.get(uuid=self.kwargs[self.pk_url_kwarg]).model_name,
"canonical_uuid": self.kwargs[self.pk_url_kwarg],
}
Expand Down

0 comments on commit 70408ab

Please sign in to comment.