Skip to content

Commit

Permalink
Fix bug with field type and fix up the test data
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris O'Dell committed Oct 6, 2020
1 parent de0b25a commit add90dd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion response/slack/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def update_user_cache(exclude_bots=False):
logger.info(f"Updating {len(users)} users in the cache")
with transaction.atomic():
for user in users:
if exclude_bots and user["is_bot"].lower() == "true":
if exclude_bots and user["is_bot"]:
continue
ExternalUser.objects.update_or_create_slack(
external_id=user["id"],
Expand Down
56 changes: 28 additions & 28 deletions tests/slack/slack_payloads.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
users_list_response = {
"ok": "True",
"ok": True,
"members": [
{
"id": "W012A3CDE",
"team_id": "T012AB3C4",
"name": "spengler",
"deleted": "False",
"deleted": False,
"color": "9f69e7",
"real_name": "spengler",
"tz": "America/Los_Angeles",
Expand All @@ -28,21 +28,21 @@
"image_512": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"team": "T012AB3C4",
},
"is_admin": "True",
"is_owner": "False",
"is_primary_owner": "False",
"is_restricted": "False",
"is_ultra_restricted": "False",
"is_bot": "False",
"is_admin": True,
"is_owner": False,
"is_primary_owner": False,
"is_restricted": False,
"is_ultra_restricted": False,
"is_bot": False,
"updated": 1502138686,
"is_app_user": "False",
"has_2fa": "False",
"is_app_user": False,
"has_2fa": False,
},
{
"id": "U12345678",
"team_id": "T0G9PQBBK",
"name": "glinda",
"deleted": "False",
"deleted": False,
"color": "9f69e7",
"real_name": "Glinda Southgood",
"tz": "America/Los_Angeles",
Expand All @@ -69,14 +69,14 @@
"display_name_normalized": "Glinda the Fairly Good",
"email": "[email protected]",
},
"is_admin": "True",
"is_owner": "False",
"is_primary_owner": "False",
"is_restricted": "False",
"is_ultra_restricted": "False",
"is_bot": "True",
"is_admin": True,
"is_owner": False,
"is_primary_owner": False,
"is_restricted": False,
"is_ultra_restricted": False,
"is_bot": True,
"updated": 1480527098,
"has_2fa": "False",
"has_2fa": False,
},
],
"cache_ts": 1498777272,
Expand All @@ -85,13 +85,13 @@


users_list_new = {
"ok": "True",
"ok": True,
"members": [
{
"id": "U10293847",
"team_id": "T012AB3C4",
"name": "venkman",
"deleted": "False",
"deleted": False,
"color": "9f69e7",
"real_name": "venkman",
"tz": "America/Los_Angeles",
Expand All @@ -114,15 +114,15 @@
"image_512": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"team": "T012AB3C4",
},
"is_admin": "True",
"is_owner": "False",
"is_primary_owner": "False",
"is_restricted": "False",
"is_ultra_restricted": "False",
"is_bot": "False",
"is_admin": True,
"is_owner": False,
"is_primary_owner": False,
"is_restricted": False,
"is_ultra_restricted": False,
"is_bot": False,
"updated": 1502138686,
"is_app_user": "False",
"has_2fa": "False",
"is_app_user": False,
"has_2fa": False,
}
],
"cache_ts": 1498777272,
Expand Down

0 comments on commit add90dd

Please sign in to comment.