Skip to content

Commit d7d26b1

Browse files
committed
Removing color from tags.
1 parent f009472 commit d7d26b1

File tree

3 files changed

+7
-31
lines changed

3 files changed

+7
-31
lines changed

intercom/intercom.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,7 @@ def reply_message_thread(
358358

359359
@classmethod
360360
def create_tag(
361-
cls, name, tag_or_untag, user_ids=None, emails=None,
362-
color=None):
361+
cls, name, tag_or_untag, user_ids=None, emails=None):
363362
""" Create a tag (and maybe tag users).
364363
365364
>>> tag = Intercom.create_tag("Free Trial", "tag",
@@ -377,17 +376,15 @@ def create_tag(
377376
'name': name,
378377
'tag_or_untag': tag_or_untag,
379378
'user_ids': user_ids,
380-
'emails': emails,
381-
'color': color
379+
'emails': emails
382380
}
383381
tag_dict = Intercom._call(
384382
'POST', Intercom.api_endpoint + 'tags', params=params)
385383
return tag_dict
386384

387385
@classmethod
388386
def update_tag(
389-
cls, name, tag_or_untag, user_ids=None, emails=None,
390-
color=None):
387+
cls, name, tag_or_untag, user_ids=None, emails=None):
391388
""" Update a tag (and maybe tag users).
392389
393390
>>> tag = Intercom.update_tag("Free Trial", "tag",
@@ -405,8 +402,7 @@ def update_tag(
405402
'name': name,
406403
'tag_or_untag': tag_or_untag,
407404
'user_ids': user_ids,
408-
'emails': emails,
409-
'color': color
405+
'emails': emails
410406
}
411407
tag_dict = Intercom._call(
412408
'PUT', Intercom.api_endpoint + 'tags', params=params)

intercom/tag.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ def find_by_name(cls, name):
5252

5353
@classmethod
5454
def create(
55-
cls, name, tag_or_untag, user_ids=None, emails=None,
56-
color=None):
55+
cls, name, tag_or_untag, user_ids=None, emails=None):
5756
""" Create a new tag an optionally tag user.
5857
5958
>>> tag = Tag.create(user_ids=["abc123", "def456"],
@@ -67,8 +66,7 @@ def create(
6766
6867
"""
6968
resp = Intercom.create_tag(
70-
name, tag_or_untag, user_ids=user_ids, emails=emails,
71-
color=color)
69+
name, tag_or_untag, user_ids=user_ids, emails=emails)
7270
return cls(resp)
7371

7472
def save(self):
@@ -86,8 +84,7 @@ def save(self):
8684
resp = Intercom.update_tag(
8785
self.name, self.get('tag_or_untag', None),
8886
user_ids=self.get('user_ids', None),
89-
emails=self.get('emails', None),
90-
color=self.color)
87+
emails=self.get('emails', None))
9188
self.update(resp)
9289

9390
@property
@@ -100,16 +97,6 @@ def name(self, name):
10097
""" Get the name of the tag. """
10198
self['name'] = name
10299

103-
@property
104-
def color(self):
105-
""" Get the color of the tag. """
106-
return dict.get(self, 'color', None)
107-
108-
@color.setter
109-
def color(self, color):
110-
""" Get the color of the tag. """
111-
self['color'] = color
112-
113100
@property
114101
def id(self):
115102
""" The id of the tag. """

tests/unit/test_tag.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,10 @@ def test_accessor(self):
6767
tag.name = "xyz"
6868
eq_("xyz", tag.name)
6969

70-
tag.color = "abc"
71-
eq_("abc", tag.color)
72-
7370
@patch('requests.request', create_response(200, 'create_tag_valid.json'))
7471
def test_create(self):
7572
tag = Tag.create(name="Poweruser", tag_or_untag="tag")
7673
eq_(None, tag.id)
77-
eq_('green', tag.color)
7874
eq_(False, tag.segment)
7975
eq_(None, tag.tagged_user_count)
8076

@@ -83,16 +79,13 @@ def test_update(self):
8379
tag = Tag()
8480
tag.save()
8581
eq_(None, tag.id)
86-
eq_('green', tag.color)
8782

8883
@patch('requests.request', create_response(200, 'get_tag_valid.json'))
8984
def test_find(self):
9085
tag = Tag.find(name="Poweruser")
9186
eq_(None, tag.id)
92-
eq_('green', tag.color)
9387

9488
@patch('requests.request', create_response(200, 'get_tag_valid.json'))
9589
def test_find_by_name(self):
9690
tag = Tag.find_by_name("Poweruser")
9791
eq_(None, tag.id)
98-
eq_('green', tag.color)

0 commit comments

Comments
 (0)