Skip to content
Snippets Groups Projects
Commit 99912d4a authored by kaiyou's avatar kaiyou
Browse files

Fix the management cli to support uuids

parent 1213ecb9
No related branches found
No related tags found
No related merge requests found
Pipeline #240 passed
......@@ -30,12 +30,12 @@ def create_user(username, password):
@trurt.command()
@click.argument("username")
@click.argument("spn")
@click.argument("service_uuid")
@click.argument("profile_username")
@flask_cli.with_appcontext
def create_profile(username, spn, profile_username):
def create_profile(username, service_uuid, profile_username):
user = models.User.query.filter_by(username=username).first()
service = models.Service.query.filter_by(spn=spn).first()
service = models.Service.query.get(service_uuid)
profile = models.Profile()
profile.user = user
profile.service = service
......
......@@ -74,15 +74,15 @@ class User(db.Model):
user = cls.query.filter_by(username=username).first()
if not user:
return False
auth = Auth.query.filter_by(user_id=user.id).first()
if not auth:
auths = user.auths
if not auths:
return False
if not auth.check_password(password):
if not auths[0].check_password(password):
return False
return user
def get_id(self):
return self.id
return self.uuid
def get_default_profile(self, service):
profile = Profile()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment