Skip to content

Commit cd3b580

Browse files
committed
Using POST updates for User and Company.
1 parent 1ddd23e commit cd3b580

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

intercom/api_operations/save.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def from_response(self, response):
3434
def save(self):
3535
collection = utils.resource_class_to_collection_name(self.__class__)
3636
params = self.__dict__
37-
if self.id_present:
37+
if self.id_present and not self.posted_updates:
3838
# update
3939
response = Intercom.put('/%s/%s' % (collection, self.id), **params)
4040
else:
@@ -49,7 +49,7 @@ def id_present(self):
4949

5050
@property
5151
def posted_updates(self):
52-
return getattr(self, 'update_verb', None) != 'post'
52+
return getattr(self, 'update_verb', None) == 'post'
5353

5454
@property
5555
def identity_hash(self):

intercom/company.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66

77
class Company(Resource, Count, Find, Load):
8-
pass
8+
update_verb = 'post'

intercom/user.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
class User(Resource, Find, FindAll, All, Count, Load, Save, Delete,
1313
IncrementableAttributes):
1414

15+
update_verb = 'post'
16+
1517
@property
1618
def flat_store_attributes(self):
1719
return ['custom_attributes']

0 commit comments

Comments
 (0)