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
76bab0b5
Commit
76bab0b5
authored
4 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Support assigning unclaimed profiles manually
parent
91752dd5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!20
Add 'remember me' button
Pipeline
#692
passed
4 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hiboo/profile/admin.py
+14
-0
14 additions, 0 deletions
hiboo/profile/admin.py
hiboo/profile/templates/profile_details.html
+2
-0
2 additions, 0 deletions
hiboo/profile/templates/profile_details.html
hiboo/profile/templates/profile_list.html
+2
-0
2 additions, 0 deletions
hiboo/profile/templates/profile_list.html
with
18 additions
and
0 deletions
hiboo/profile/admin.py
+
14
−
0
View file @
76bab0b5
from
hiboo.profile
import
blueprint
from
hiboo
import
security
,
models
from
hiboo
import
user
as
hiboo_user
from
flask_babel
import
lazy_gettext
as
_
import
flask
...
...
@@ -56,3 +57,16 @@ def set_status(profile_uuid, status):
models
.
db
.
session
.
commit
()
flask
.
flash
(
_
(
"
Profile status was successfully changed
"
),
"
success
"
)
return
flask
.
redirect
(
flask
.
url_for
(
"
.details
"
,
profile_uuid
=
profile_uuid
))
@blueprint.route
(
"
/assign/<profile_uuid>
"
,
methods
=
[
"
GET
"
,
"
POST
"
])
@security.admin_required
()
def
assign
(
profile_uuid
):
profile
=
models
.
Profile
.
query
.
get
(
profile_uuid
)
or
flask
.
abort
(
404
)
assert
profile
.
status
==
"
unclaimed
"
user
=
hiboo_user
.
get_user
(
intent
=
"
profile.assign
"
,
profile_uuid
=
profile_uuid
)
profile
.
user_uuid
=
user
.
uuid
profile
.
status
=
"
active
"
models
.
db
.
session
.
commit
()
flask
.
flash
(
_
(
"
Successfully assigned the profile
"
),
"
success
"
)
return
flask
.
redirect
(
flask
.
url_for
(
"
.details
"
,
profile_uuid
=
profile_uuid
))
This diff is collapsed.
Click to expand it.
hiboo/profile/templates/profile_details.html
+
2
−
0
View file @
76bab0b5
...
...
@@ -43,5 +43,7 @@
<a
href=
"{{ url_for("
profile.set_status
",
profile_uuid=
profile.uuid,
status=
"active"
)
}}"
class=
"btn btn-success"
>
{% trans %}Unblock profile{% endtrans %}
</a>
{% elif profile.status == "request" %}
<a
href=
"{{ url_for("
profile.set_status
",
profile_uuid=
profile.uuid,
status=
"active"
)
}}"
class=
"btn btn-success"
>
{% trans %}Validate profile{% endtrans %}
</a>
{% elif profile.status == "unclaimed" %}
<a
href=
"{{ url_for("
profile.assign
",
profile_uuid=
profile.uuid)
}}"
class=
"btn btn-info"
>
{% trans %}Validate profile{% endtrans %}
</a>
{% endif %}
{% endblock %}
This diff is collapsed.
Click to expand it.
hiboo/profile/templates/profile_list.html
+
2
−
0
View file @
76bab0b5
...
...
@@ -49,6 +49,8 @@
<a
href=
"{{ url_for("
profile.set_status
",
profile_uuid=
profile.uuid,
status=
"active"
)
}}"
>
{% trans %}Unblock profile{% endtrans %}
</a>
{% elif profile.status == "request" %}
<a
href=
"{{ url_for("
profile.set_status
",
profile_uuid=
profile.uuid,
status=
"active"
)
}}"
>
{% trans %}Validate profile{% endtrans %}
</a>
{% elif profile.status == "unclaimed" %}
<a
href=
"{{ url_for("
profile.assign
",
profile_uuid=
profile.uuid)
}}"
>
{% trans %}Assign profile{% endtrans %}
</a>
{% endif %}
</td>
</tr>
...
...
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