Skip to content

Commit

Permalink
Feat: Don't allow SMS and Whatsapp notifications to go to the same user
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansberry committed Jan 8, 2025
1 parent 127dce4 commit 2cbe542
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ckanext/dataset_subscriptions/actions/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ def _validate_plugin_extras(extras):
errors['activity_streams_sms_notifications'] = [
toolkit._('No phone number given')
]
if toolkit.asbool(extras.get('activity_streams_whatsapp_notifications')):
errors['activity_streams_sms_notifications'] = [
toolkit._('Please select either Whatsapp or SMS notifications - not both. ')
]
if toolkit.asbool(extras.get('activity_streams_whatsapp_notifications')):
if not extras.get('phonenumber'):
errors['activity_streams_whatsapp_notifications'] = [
Expand Down

0 comments on commit 2cbe542

Please sign in to comment.