Adapt conditions_ids in changeset_controller

- raise exception on empty changesets
- simplify where clause construction