sanger/sequencescape — pull request #215 by mattdenner (2011-10-10 11:12:06+00:00)
Title: [fixes 17902575] Allow study owner to be properly set

The owner/manager information wasn't being set properly on a study
because the study itself hadn't been saved before the role was being
set. This refactors the code to ensure that the study exists first.

It also addresses the problem where PMs could not change the owner of a
study, which was completely missing, and ensures that if there are more
than one owner they are not all removed. In other words, it should
behave appropriately if there is only ever one owner, which the UI
suggests but doesn't necessarily enforce.