Skip to content

Commit

Permalink
RF update work title to remove hanging dash
Browse files Browse the repository at this point in the history
  • Loading branch information
tolkamps1 committed Dec 5, 2024
1 parent 03068f9 commit eb53c2a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion epictrack-api/src/api/models/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
String,
Text,
and_,
case,
exists,
func,
or_
Expand Down Expand Up @@ -143,7 +144,15 @@ def title(self):
def title(self):
"""SQL expression for title."""
from api.models.work_type import WorkType # pylint:disable=import-outside-toplevel
return func.concat(Project.name, " - ", WorkType.name, " - ", self.simple_title) # pylint:disable=not-callable
return (
case(
(
func.coalesce(self.simple_title, "") != "",
func.concat(Project.name, " - ", WorkType.name, " - ", self.simple_title), # pylint:disable=not-callable
),
else_=func.concat(Project.name, " - ", WorkType.name)
)
)

@hybrid_property
def anticipated_referral_date(self):
Expand Down

0 comments on commit eb53c2a

Please sign in to comment.