Refactor user update logic function
Merge branch 'release-v2.0.1-dgu' of github.com:datagovuk/ckan into release-v2.0.1-dgu