Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twitter: option to tweet/disable system session join events. #363

Merged
merged 1 commit into from
Jun 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pykeg/contrib/twitter/forms.py
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion pykeg/contrib/twitter/plugin.py
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions pykeg/contrib/twitter/plugin_test.py
Original file line number Diff line number Diff line change
@@ -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,