def join(self): loggedInUser = helper.getLoggedInUser() if loggedInUser: return error("You are logged in. You cannot create an account.", AlreadyLoggedInError) theData = json.loads(helper.getRequestBody()) if theData.get("userName"): theData["userName"] = theData["userName"].strip() valid, msg, errType = self.isValid(theData) result = None if valid: theUser = SSUser.create(theData) helper.setLoggedInUser(theUser.id) return data(theUser) else: return error(msg, errType)
def setUp(self): db = core.connect() self.fakemary = SSUser.create(fakemary) self.fakejohn = SSUser.create(fakejohn) self.fakebob = SSUser.create(fakebob) self.root = SSUser.read("shiftspace")
def setUp(self): db = core.connect() self.fakemary = SSUser.create(fakemary).id self.root = SSUser.read("shiftspace").id