Skip to content

Commit

Permalink
Merge pull request #2 from macroeyes/feature/include_username
Browse files Browse the repository at this point in the history
Include username in message
  • Loading branch information
lamby committed Feb 25, 2015
2 parents e711757 + 4316cf9 commit 035cc9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_slack/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ def render(component):
'channel': app_settings.CHANNEL,
'icon_url': app_settings.ICON_URL,
'icon_emoji': app_settings.ICON_EMOJI,
'username': app_settings.USERNAME
}

# Filter actually defined values
data = {k: v for k, v in data.iteritems() if v}

# Render template
for part in ('token', 'channel', 'text', 'icon_url', 'icon_emoji'):
for part in ('token', 'channel', 'text', 'icon_url', 'icon_emoji', 'username'):
try:
txt = render(part)
except Exception:
Expand Down

0 comments on commit 035cc9f

Please sign in to comment.