Skip to content

Commit 4b0bf54

Browse files
Merge pull request #2 from pusher/support-dash
Interest name can include dash character
2 parents db4a6af + 2b9fe0e commit 4b0bf54

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

pusher_push_notifications/__init__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import requests
77
import six
88

9-
SDK_VERSION = '0.9.1'
9+
SDK_VERSION = '0.9.2'
1010
INTEREST_MAX_LENGTH = 164
11-
INTEREST_REGEX = re.compile('^(_|=|@|,|\\.|:|[A-Z]|[a-z]|[0-9])*$')
11+
INTEREST_REGEX = re.compile('^(_-|=|@|,|\\.|:|[A-Z]|[a-z]|[0-9])*$')
1212

1313

1414
class PusherValidationError(ValueError):
@@ -119,13 +119,6 @@ def publish(self, interests, publish_body):
119119
INTEREST_MAX_LENGTH,
120120
)
121121
)
122-
if '-' in interest:
123-
raise ValueError(
124-
'Interest "{}" contains a "-" which is forbidden. '.format(
125-
interest,
126-
)
127-
+ 'have you considered using a "_" instead?'
128-
)
129122
if not INTEREST_REGEX.match(interest):
130123
raise ValueError(
131124
'Interest "{}" contains a forbidden character. '.format(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from codecs import open
33
from os import path
44

5-
__version__ = '0.9.1'
5+
__version__ = '0.9.2'
66

77
here = path.abspath(path.dirname(__file__))
88

tests/test_push_notifications.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def test_publish_should_make_correct_http_request(self):
108108
'content-type': 'application/json',
109109
'content-length': '69',
110110
'authorization': 'Bearer SECRET_KEY',
111-
'x-pusher-library': 'pusher-push-notifications-python 0.9.1',
111+
'x-pusher-library': 'pusher-push-notifications-python 0.9.2',
112112
'host': 'instance_id.pushnotifications.pusher.com',
113113
},
114114
)
@@ -217,7 +217,7 @@ def test_publish_should_fail_if_interest_contains_invalid_chars(self):
217217
)
218218
with self.assertRaises(ValueError):
219219
pn_client.publish(
220-
interests=['bad-interest'],
220+
interests=['bad|interest'],
221221
publish_body={
222222
'apns': {
223223
'aps': {

0 commit comments

Comments
 (0)