Conversation
|
let's not cut off partial imports, it's perfectly fine to only offer required values as long as it passes validations. |
|
IMO, validations should not allow the config backup to be imported as dhcp entries or firewall rules. And firewall rules should not be allowed to be imported as dhcp entries :) Thus, a more comprehensive validation could be created per instance to catch more things but this PR prevents the more crude errors without over-validating everything, in a sense, promoting what you suggest. Also, the error message tells you what you are missing. If you know what you are doing you just add them manually. |
|
If the model supports empty records to be added, it's easy to render new (empty) records indeed, which might be less practical, but also a bit part of the deal I'm afraid. I don't mind looking at options to at least require something being inserted, the question just is what that should be. requiring keys doesn't really make it less fragile as in time a lot of these things have similar keys like a uuid. |
|
If you believe that more than one CSV uses exactly the same keys then this doesn't make much sense. In my experience, they don't, but haven't really looked it up. Requiring something to be inserted is not a bad idea, but it will break many already saved files :( |
Fixes: #9861
And many more CSV imports.
In my testing, it works well with all the CSV imports. It might be a bit simplistic, but it is great for blocking careless mistakes.