Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-backend
Commits
e2e2d196
Unverified
Commit
e2e2d196
authored
6 years ago
by
florimondmanca
Browse files
Options
Downloads
Patches
Plain Diff
refactor participation user link display field
parent
4147b626
No related branches found
No related tags found
1 merge request
!5
Refactor participation user link display field
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
visits/admin.py
+7
-5
7 additions, 5 deletions
visits/admin.py
with
7 additions
and
5 deletions
visits/admin.py
+
7
−
5
View file @
e2e2d196
...
...
@@ -113,14 +113,16 @@ reject_selected_participations.short_description = (
class
ParticipationAdmin
(
admin
.
ModelAdmin
):
"""
Admin panel for visit participations.
"""
list_display
=
(
'
submitted
'
,
'
visit
'
,
'
user_link
'
,
'
accepted
'
,
'
present
'
)
list_display
=
(
'
submitted
'
,
'
visit
'
,
'
user_link
'
,
'
accepted
'
,
'
present
'
)
list_filter
=
(
'
submitted
'
,
'
accepted
'
,
'
present
'
)
actions
=
[
accept_selected_participations
,
reject_selected_participations
]
def
user_link
(
self
,
book
):
url
=
reverse
(
"
admin:users_user_change
"
,
args
=
[
book
.
user
.
id
])
link
=
'
<a href=
"
%s
"
>%s</a>
'
%
(
url
,
book
.
user
.
email
)
def
user_link
(
self
,
participation
:
Participation
):
"""
Return a link to the participation
'
s user.
"""
url
=
reverse
(
"
admin:users_user_change
"
,
args
=
[
participation
.
user
.
id
])
link
=
f
'
<a href=
"
{
url
}
"
>
{
participation
.
user
}
</a>
'
return
mark_safe
(
link
)
user_link
.
short_description
=
'
Utilisateur
'
...
...
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