{"action":"created","issue":{"url":"https://api.github.com/repos/CCI-MOC/haas/issues/308","repository_url":"https://api.github.com/repos/CCI-MOC/haas","labels_url":"https://api.github.com/repos/CCI-MOC/haas/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/CCI-MOC/haas/issues/308/comments","events_url":"https://api.github.com/repos/CCI-MOC/haas/issues/308/events","html_url":"https://github.com/CCI-MOC/haas/issues/308","id":46533842,"number":308,"title":"Use correct SQLAlchemy methods","user":{"login":"ryabouza","id":8089985,"avatar_url":"https://avatars.githubusercontent.com/u/8089985?v=3","gravatar_id":"","url":"https://api.github.com/users/ryabouza","html_url":"https://github.com/ryabouza","followers_url":"https://api.github.com/users/ryabouza/followers","following_url":"https://api.github.com/users/ryabouza/following{/other_user}","gists_url":"https://api.github.com/users/ryabouza/gists{/gist_id}","starred_url":"https://api.github.com/users/ryabouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryabouza/subscriptions","organizations_url":"https://api.github.com/users/ryabouza/orgs","repos_url":"https://api.github.com/users/ryabouza/repos","events_url":"https://api.github.com/users/ryabouza/events{/privacy}","received_events_url":"https://api.github.com/users/ryabouza/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CCI-MOC/haas/labels/cleanup","name":"cleanup","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/CCI-MOC/haas/milestones/9","html_url":"https://github.com/CCI-MOC/haas/milestones/0.3","labels_url":"https://api.github.com/repos/CCI-MOC/haas/milestones/9/labels","id":1631840,"number":9,"title":"0.3","description":"Next release after 0.2","creator":{"login":"henn","id":1813729,"avatar_url":"https://avatars.githubusercontent.com/u/1813729?v=3","gravatar_id":"","url":"https://api.github.com/users/henn","html_url":"https://github.com/henn","followers_url":"https://api.github.com/users/henn/followers","following_url":"https://api.github.com/users/henn/following{/other_user}","gists_url":"https://api.github.com/users/henn/gists{/gist_id}","starred_url":"https://api.github.com/users/henn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henn/subscriptions","organizations_url":"https://api.github.com/users/henn/orgs","repos_url":"https://api.github.com/users/henn/repos","events_url":"https://api.github.com/users/henn/events{/privacy}","received_events_url":"https://api.github.com/users/henn/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-03-09T00:33:36Z","updated_at":"2016-03-09T00:33:48Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-10-22T16:59:00Z","updated_at":"2016-03-09T00:34:01Z","closed_at":null,"body":"We should be using .one(), .count() or .exists() in many cases where we are just using .first() for DB queries."},"comment":{"url":"https://api.github.com/repos/CCI-MOC/haas/issues/comments/194037516","html_url":"https://github.com/CCI-MOC/haas/issues/308#issuecomment-194037516","issue_url":"https://api.github.com/repos/CCI-MOC/haas/issues/308","id":194037516,"user":{"login":"henn","id":1813729,"avatar_url":"https://avatars.githubusercontent.com/u/1813729?v=3","gravatar_id":"","url":"https://api.github.com/users/henn","html_url":"https://github.com/henn","followers_url":"https://api.github.com/users/henn/followers","following_url":"https://api.github.com/users/henn/following{/other_user}","gists_url":"https://api.github.com/users/henn/gists{/gist_id}","starred_url":"https://api.github.com/users/henn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henn/subscriptions","organizations_url":"https://api.github.com/users/henn/orgs","repos_url":"https://api.github.com/users/henn/repos","events_url":"https://api.github.com/users/henn/events{/privacy}","received_events_url":"https://api.github.com/users/henn/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T00:34:01Z","updated_at":"2016-03-09T00:34:01Z","body":"FYI - we currently are using a couple of methods that could be replaced by these like `_must_find()`.\r\n\r\nOnce we implement this, we should probably catch the [appropriate exceptions](http://docs.sqlalchemy.org/en/rel_1_0/orm/query.html?highlight=one#sqlalchemy.orm.query.Query.one) in the framework and display appropriate errors.\r\n"}}