diff --git a/pinaxcon/templates/symposion/schedule/presentation_detail.html b/pinaxcon/templates/symposion/schedule/presentation_detail.html index 4a990cfa..4cbf5517 100644 --- a/pinaxcon/templates/symposion/schedule/presentation_detail.html +++ b/pinaxcon/templates/symposion/schedule/presentation_detail.html @@ -33,7 +33,7 @@
{{ speaker }}
{% if speaker.twitter_username %}
- {{ speaker.twitter_username }}
+ {{ speaker.twitter_username|twitter_handle }}
{% endif %}
{% if speaker.homepage %}
{{ speaker.homepage }}
diff --git a/pinaxcon/templatetags/lca2019_tags.py b/pinaxcon/templatetags/lca2019_tags.py
index 9bad403d..cbb55050 100644
--- a/pinaxcon/templatetags/lca2019_tags.py
+++ b/pinaxcon/templatetags/lca2019_tags.py
@@ -36,4 +36,9 @@ def listlookup(lookup, target):
@register.filter
def clean_text(txt):
# Remove double/triple/+ spaces from `txt` and replace with single space
- return re.sub(r' {2,}' , ' ', txt)
\ No newline at end of file
+ return re.sub(r' {2,}' , ' ', txt)
+
+@register.filter
+def twitter_handle(txt):
+ # Add @ to twitter handle if not present
+ return txt if txt.startswith('@') else '@{}'.format(txt)
\ No newline at end of file