Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hiboo
Commits
99912d4a
Commit
99912d4a
authored
5 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Fix the management cli to support uuids
parent
1213ecb9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#240
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
trurt/manage.py
+3
-3
3 additions, 3 deletions
trurt/manage.py
trurt/models.py
+4
-4
4 additions, 4 deletions
trurt/models.py
with
7 additions
and
7 deletions
trurt/manage.py
+
3
−
3
View file @
99912d4a
...
...
@@ -30,12 +30,12 @@ def create_user(username, password):
@trurt.command
()
@click.argument
(
"
username
"
)
@click.argument
(
"
s
pn
"
)
@click.argument
(
"
s
ervice_uuid
"
)
@click.argument
(
"
profile_username
"
)
@flask_cli.with_appcontext
def
create_profile
(
username
,
s
pn
,
profile_username
):
def
create_profile
(
username
,
s
ervice_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
...
...
This diff is collapsed.
Click to expand it.
trurt/models.py
+
4
−
4
View file @
99912d4a
...
...
@@ -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
:
auth
s
=
user
.
auths
if
not
auth
s
:
return
False
if
not
auth
.
check_password
(
password
):
if
not
auth
s
[
0
]
.
check_password
(
password
):
return
False
return
user
def
get_id
(
self
):
return
self
.
id
return
self
.
uu
id
def
get_default_profile
(
self
,
service
):
profile
=
Profile
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment