refactor(core): To obtain audit_values loop through model fields
ref: #770 #767
This commit is contained in:
@ -126,20 +126,14 @@ class CenturionModel(
|
||||
|
||||
clean_data: dict = {}
|
||||
|
||||
for name, data in data.items():
|
||||
for field in self._meta.fields:
|
||||
|
||||
for field in self._meta.fields:
|
||||
|
||||
if name == field.name:
|
||||
|
||||
clean_data.update({
|
||||
name: data
|
||||
})
|
||||
|
||||
break
|
||||
clean_data.update({
|
||||
field.name: getattr(self, field.name)
|
||||
})
|
||||
|
||||
|
||||
return data
|
||||
return clean_data
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user