{"action":"closed","issue":{"url":"https://api.github.com/repos/bplower/cssef/issues/34","repository_url":"https://api.github.com/repos/bplower/cssef","labels_url":"https://api.github.com/repos/bplower/cssef/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/bplower/cssef/issues/34/comments","events_url":"https://api.github.com/repos/bplower/cssef/issues/34/events","html_url":"https://github.com/bplower/cssef/issues/34","id":139406422,"number":34,"title":"Improve user creation accounting process","user":{"login":"bplower","id":3588764,"avatar_url":"https://avatars.githubusercontent.com/u/3588764?v=3","gravatar_id":"","url":"https://api.github.com/users/bplower","html_url":"https://github.com/bplower","followers_url":"https://api.github.com/users/bplower/followers","following_url":"https://api.github.com/users/bplower/following{/other_user}","gists_url":"https://api.github.com/users/bplower/gists{/gist_id}","starred_url":"https://api.github.com/users/bplower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bplower/subscriptions","organizations_url":"https://api.github.com/users/bplower/orgs","repos_url":"https://api.github.com/users/bplower/repos","events_url":"https://api.github.com/users/bplower/events{/privacy}","received_events_url":"https://api.github.com/users/bplower/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bplower/cssef/labels/Core%20Server","name":"Core Server","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bplower/cssef/milestones/2","html_url":"https://github.com/bplower/cssef/milestones/Initial%20release%20-%20version%200.1.0","labels_url":"https://api.github.com/repos/bplower/cssef/milestones/2/labels","id":1285610,"number":2,"title":"Initial release - version 0.1.0","description":"This will be the first proper release, where the framework is actually functional and not horribly broken. The functional components will *not* include the WebAPI due to time constraints and pending design considerations.","creator":{"login":"bplower","id":3588764,"avatar_url":"https://avatars.githubusercontent.com/u/3588764?v=3","gravatar_id":"","url":"https://api.github.com/users/bplower","html_url":"https://github.com/bplower","followers_url":"https://api.github.com/users/bplower/followers","following_url":"https://api.github.com/users/bplower/following{/other_user}","gists_url":"https://api.github.com/users/bplower/gists{/gist_id}","starred_url":"https://api.github.com/users/bplower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bplower/subscriptions","organizations_url":"https://api.github.com/users/bplower/orgs","repos_url":"https://api.github.com/users/bplower/repos","events_url":"https://api.github.com/users/bplower/events{/privacy}","received_events_url":"https://api.github.com/users/bplower/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":3,"state":"open","created_at":"2015-09-02T06:28:09Z","updated_at":"2016-03-13T02:00:15Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-03-08T22:02:18Z","updated_at":"2016-03-13T02:00:15Z","closed_at":"2016-03-13T02:00:15Z","body":"User creation alone doesn't update the associated Organizations user accounting. So adding a new user via `User.fromDict()` won't update the associated organizations `Organization.numMembers` value. To solve this, I implemented `Organization.createMember()`, which will do that additional accounting, which is a messy solution. Instead, the User class should define it's own `fromDict()` and do the organization account from there.\r\n\r\n```python\r\n@classmethod\r\ndef fromDict(cls, db, kwDict):\r\n\torg = organization(pkid=kwDict['organization'])\r\n\tif org.numMembers >= org.maxMembers:\r\n\t\traise MaxMembersReached(org.maxMembers)\r\n\tsuper(User, self).fromDict(kwDict)\r\n\torg.setNumMembers()\r\n\treturn clsInst\r\n```"}}