Esempio n. 1
0
    def signup(self, document):
        user = None
        if not document["password"]:
            user = User(firstName=document["firstName"],
                        lastName=document["lastName"],
                        email=document["email"],
                        organization=document["organization"],
                        location=document["location"],
                        userType=document["userType"],
                        isAdmin=False,
                        recentDatasets=[],
                        resetId="",
                        confirmationId="",
                        isConfirmed=True)
        else:
            user = User(firstName=document["firstName"],
                        lastName=document["lastName"],
                        email=document["email"],
                        password=document["password"],
                        organization=document["organization"],
                        location=document["location"],
                        userType=document["userType"],
                        isAdmin=False,
                        recentDatasets=[],
                        resetId="",
                        confirmationId="",
                        isConfirmed=False)

        user.validate(
        )  # TODO: enclose this in a try/catch block /check if its an error with the type entered

        if (self.save(user)):
            return True
        else:
            return False
    def signup(self, document):
        user = User(firstName=document["firstName"],
                    lastName=document["lastName"],
                    email=document["email"],
                    password=document["password"])

        user.validate(
        )  # TODO: enclose this in a try/catch block /check if its an error with the type entered

        if (self.save(user)):
            return True
        else:
            return False