Merge branch 'master' into alerting_definitions

This commit is contained in:
Torkel Ödegaard
2016-06-08 09:36:50 +02:00
20 changed files with 374 additions and 231 deletions

View File

@@ -26,6 +26,12 @@ func AddOrgUser(cmd *m.AddOrgUserCommand) error {
return m.ErrOrgUserAlreadyAdded
}
if res, err := sess.Query("SELECT 1 from org WHERE id=?", cmd.OrgId); err != nil {
return err
} else if len(res) != 1 {
return m.ErrOrgNotFound
}
entity := m.OrgUser{
OrgId: cmd.OrgId,
UserId: cmd.UserId,