Skip to content

Commit

Permalink
Merge pull request #363 from Kegbot/mikey/twitter-events
Browse files Browse the repository at this point in the history
twitter: option to tweet/disable system session join events.
  • Loading branch information
mik3y authored Jun 26, 2017
2 parents 88e5d55 + ba07223 commit 56d2423
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pykeg/contrib/twitter/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class SiteSettingsForm(forms.Form):
help_text='Tweet when a keg is started or ended.')
tweet_session_events = forms.BooleanField(initial=True, required=False,
help_text='Tweet when a new session is started.')
tweet_session_joined_events = forms.BooleanField(initial=False, required=False,
help_text='Tweet someone joins a session.')
tweet_drink_events = forms.BooleanField(
initial=False,
required=False,
Expand Down
2 changes: 1 addition & 1 deletion pykeg/contrib/twitter/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _issue_system_tweet(self, event, settings, site_profile):
template = settings.get('session_started_template')

elif kind == event.SESSION_JOINED:
if not settings.get('tweet_session_events'):
if not settings.get('tweet_session_joined_events'):
self.logger.info(
'Skipping system tweet for session join event %s: disabled by settings.' %
event.id)
Expand Down
1 change: 1 addition & 0 deletions pykeg/contrib/twitter/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_get_site_twitter_settings_form(self):
expected = {
'tweet_keg_events': True,
'tweet_session_events': True,
'tweet_session_joined_events': False,
'tweet_drink_events': False,
'include_guests': True,
'include_pictures': False,
Expand Down

0 comments on commit 56d2423

Please sign in to comment.