Пример #1
0
    def do_action(self):
        print "CLEANED", self.cleaned_data
        try:
            connect ('user', port=27777)
            users = Users()
        except:
            print "ERROR: Internal Server error, please contact the admin"
            pass

        try:
            user = User (
                title = self.cleaned_data["title"],
                firstname = self.cleaned_data["firstname"],
                lastname = self.cleaned_data["lastname"],
                email = self.cleaned_data["email"], 
                username = self.cleaned_data["username"], 
                password = self.cleaned_data["password"],
                phone = self.cleaned_data["phone"], 
                department = self.cleaned_data["department"], 
                institution = self.cleaned_data["institution"],
                address = self.cleaned_data["address"],
                country = self.cleaned_data["country"],
                citizenship = self.cleaned_data["citizenship"],
                bio = self.cleaned_data["bio"],
            )
            users.add(user)
            pass
        except Exception, e:
            print e
            pass
Пример #2
0
 def run(self):
     banner("Install Cloudmesh Management")
     obj = Mongo()
     obj.check_mongo()
     get_mongo_db("manage", DBConnFactory.TYPE_MONGOENGINE)
     install.run(self)
     banner("Adding Super User")
     users = Users()
     found = User.objects(username='******')
     if not found:
         data = User(
             status="approved",
             title="None",
             firstname="Super",
             lastname="User",
             email="*****@*****.**",
             username="******",
             active=True,
             password=sha256_crypt.encrypt("MyPassword"),
             phone="555-555-5555",
             department="IT",
             institution="IU",
             institutionrole="Other",
             address="IU",
             country="United States(US)",
             citizenship="United States(US)",
             bio="Manage Project Committee",
             url="http://cloudmesh.github.io/cloudmesh.html",
             advisor="None",
             confirm=sha256_crypt.encrypt("MyPassword"),
             projects=[],
         )
         users.add(data)
    def do_action(self):
        print "CLEANED", self.cleaned_data
        try:
            connect('user', port=27777)
            users = Users()
        except:
            print "ERROR: Internal Server error, please contact the admin"
            pass

        try:
            user = User(
                title=self.cleaned_data["title"],
                firstname=self.cleaned_data["firstname"],
                lastname=self.cleaned_data["lastname"],
                email=self.cleaned_data["email"],
                username=self.cleaned_data["username"],
                password=self.cleaned_data["password"],
                phone=self.cleaned_data["phone"],
                department=self.cleaned_data["department"],
                institution=self.cleaned_data["institution"],
                address=self.cleaned_data["address"],
                country=self.cleaned_data["country"],
                citizenship=self.cleaned_data["citizenship"],
                bio=self.cleaned_data["bio"],
            )
            users.add(user)
            pass
        except Exception, e:
            print e
            pass
Пример #4
0
 def run(self):
     banner("Install Cloudmesh Management")
     obj = Mongo()
     obj.check_mongo()
     get_mongo_db("manage", DBConnFactory.TYPE_MONGOENGINE)
     install.run(self)
     banner("Adding Super User")
     users = Users()
     found = User.objects(username='******')
     if not found:
         data = User(
             status="approved",
             title="None",
             firstname="Super",
             lastname="User",
             email="*****@*****.**",
             username="******",
             active=True,
             password=sha256_crypt.encrypt("MyPassword"),
             phone="555-555-5555",
             department="IT",
             institution="IU",
             institutionrole="Other",
             address="IU",
             country="United States(US)",
             citizenship="United States(US)",
             bio="Manage Project Committee",
             url="http://cloudmesh.github.io/cloudmesh.html",
             advisor="None",
             confirm=sha256_crypt.encrypt("MyPassword"),
             projects=[],
         )
         users.add(data)