[server] Simplify update mechanism of access-fields. Fixes #957.
This MR aims at simplifying the update of the AccessFields when updating an access.
Several things had to be taken into account :
- it is necessary to use the
.savemethod, and not
.updatecan only update and access, and not the fields attached to it.
- the ORM does not delete an access_field from the database, if we omit it in the
fieldsproperty of an access, it tries to set the
access_fieldto null, which is not allowed by the DB (this would anyway lead to orphans), so we need to manually delete the appropriate fields.
AccessFieldentity could be 'cleaned' a bit more (removing all the unused methods), but I chose not to, as I thought it could be useful to keep them, but in the mean time, the code is not used. I have no strong opinion, so tell me which option you prefer :)
- I changed the client so that we do not transmit a field which has value
''to the server (meaning the field is empty, and is omitted by the user). This could be filtered server side (or both sides). This part is clearly to be discussed.