ArnesSI / netbox-inventory

Manage your hardware inventory in NetBox
MIT License
205 stars 21 forks source link

fix bulk update via CSV when some fields were not specified #93

Closed matejv closed 1 year ago

matejv commented 1 year ago

in _create_related_objects() we call field's .clean() method for some properties of related objects (like model_comments). However when doing update rather than import, fields not given in CSV are removed from self.fieds. That resulted in KeyError when model_comments (and possibly others) was not specified. Rather than accessing field via self.field, we use self.base_fields that has all the fields still