Skip to content

Commit

Permalink
fix: use value from model_to_dict instead of getattr
Browse files Browse the repository at this point in the history
This gives us a more meaningful represeantaion of the value
  • Loading branch information
b1rger committed Oct 16, 2023
1 parent 0b8b639 commit f07c7b7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apis_core/apis_entities/detail_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ def get(self, request, *args, **kwargs):
no_merge_labels = []

relevant_fields = []
for field in model_to_dict(self.instance).keys():
relevant_fields.append(
(self.instance._meta.get_field(field), getattr(self.instance, field))
)
for field, value in model_to_dict(self.instance).items():
relevant_fields.append((self.instance._meta.get_field(field), value))

return HttpResponse(
template.render(
Expand Down

0 comments on commit f07c7b7

Please sign in to comment.