Skip to content

Commit

Permalink
put in way for objects to show their own tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Aron Nochenson committed Sep 10, 2020
1 parent 853ccc9 commit 1fd6a8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gdpr_assist/admin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def anonymise_view(self, request):
tree_html = ""

tree = self.model.get_anonymisation_tree(objs=objects).replace(" [set_field]", "").replace(" [fk]", "")

if hasattr(objects.first(), 'get_anonymisation_tree_for_obj'):
tree = "\n".join([o.get_anonymisation_tree_for_obj() for o in objects])

this_html = "{model_name}:\n{tree}\n\n".format(model_name=self.model.__name__, tree=tree)
if self.model.__name__ != "RetentionPolicyItem":
this_html = "<pre>{html}</pre>".format(html=this_html)
Expand Down

0 comments on commit 1fd6a8c

Please sign in to comment.