Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
anthologia-site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
ecrinum
anthologia
anthologia-site
Merge requests
!157
Something went wrong on our end
Fix the error when displaying algnments admin page
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix the error when displaying algnments admin page
alignments-admin
into
preprod
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
David Larlet
requested to merge
alignments-admin
into
preprod
1 month ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
a7fcb49a
Show latest version
1 file
+
4
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
a7fcb49a
Fix the error when displaying algnments admin page
· a7fcb49a
David Larlet
authored
1 month ago
Fixes
#296
django/meleager/admin/alignment.py
+
4
−
1
Options
from
reversion_compare.admin
import
CompareVersionAdmin
from
django.contrib
import
admin
from
django.urls
import
reverse
from
django.utils.safestring
import
mark_safe
from
reversion_compare.admin
import
CompareVersionAdmin
from
meleager.models
import
Alignment
@@ -15,6 +16,8 @@ class AlignmentAdmin(CompareVersionAdmin):
@admin.display
(
description
=
"
Passage
"
)
def
first_passage_link
(
self
,
obj
):
if
not
obj
.
text_1
:
return
""
passage
=
obj
.
text_1
.
passages
.
select_related
(
"
book
"
).
first
()
url
=
reverse
(
f
"
admin:
{
passage
.
_meta
.
app_label
}
_
{
passage
.
_meta
.
model_name
}
_change
"
,
Loading