An often overlooked step when updating an entity is reverting invalid changes. While often unnecessary, doing so is borderline good practice.
Here is a typical edit controller which renders a pre-filled form and validates changes to the entity being edited.
/**
* Edit user attributes