Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
#463 truncate long urls in Vial > Admin > Reports (#552)
Browse files Browse the repository at this point in the history
Co-authored-by: Shashank Ramaprasad <[email protected]>
  • Loading branch information
shashank025 and Shashank Ramaprasad authored May 17, 2021
1 parent e4e8a05 commit ecd254f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ __pycache__
.vscode
.DS_Store
.env
venv
/vaccinate/staticfiles/
5 changes: 4 additions & 1 deletion vaccinate/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from django.utils import dateformat, timezone
from django.utils.html import escape, format_html
from django.utils.safestring import mark_safe
from django.utils.text import Truncator
from reversion.models import Revision, Version
from reversion_compare.admin import CompareVersionAdmin

Expand Down Expand Up @@ -1021,7 +1022,9 @@ def appointment_tag_and_scheduling(self, obj):
raw_details.startswith("http://") or raw_details.startswith("https://")
):
details = format_html(
'<a target="_blank" href="{}">{}</a>', raw_details, raw_details
'<a target="_blank" href="{}">{}</a>',
raw_details,
Truncator(raw_details).chars(75),
)
else:
details = escape(raw_details or "")
Expand Down

0 comments on commit ecd254f

Please sign in to comment.