@@ -78,7 +78,7 @@ def __init__(self, api_key, api_secret, app_id, version='v1.0', timeout=6.0, bas
7878
7979 self .session = requests .Session ()
8080 self .auth = HTTPSignatureAuth (api_key , secret = api_secret )
81-
81+
8282 # setup personalization
8383 from stream .personalization import Personalization
8484 token = self .create_jwt_token ('personalization' , '*' , feed_id = '*' , user_id = '*' )
@@ -87,7 +87,7 @@ def __init__(self, api_key, api_secret, app_id, version='v1.0', timeout=6.0, bas
8787 from stream .collections import Collections
8888 token = self .create_jwt_token ('collections' , '*' , feed_id = '*' , user_id = '*' )
8989 self .collections = Collections (self , token )
90-
90+
9191
9292 def feed (self , feed_slug , user_id ):
9393 '''
@@ -214,7 +214,7 @@ def _make_request(self, method, relative_url, signature, service_name='api', par
214214 relative_url += '/'
215215
216216 url = self .get_full_url (service_name , relative_url )
217-
217+
218218 if method .__name__ in ['post' , 'put' , 'delete' ]:
219219 serialized = serializer .dumps (data )
220220 response = method (url , data = serialized , headers = headers ,
@@ -376,12 +376,12 @@ def activity_partial_update(self, id=None, foreign_id=None, time=None, set={}, u
376376 'unset' : unset ,
377377 }
378378
379- if id :
379+ if id is not None :
380380 data ['id' ] = id
381381 else :
382382 data ['foreign_id' ] = foreign_id
383383 data ['time' ] = time
384-
384+
385385 return self .post ('activity/' , auth_token , data = data )
386386
387387 def create_redirect_url (self , target_url , user_id , events ):
0 commit comments