fix: remove status from watcha_user_list

code_spécifique_watcha
Kevin ICOL 4 years ago committed by c-cal
parent 2f51d00bb5
commit c0a8e7f715
Signed by: watcha
GPG Key ID: 87DD78E7F7A1581D
  1. 1
      synapse/handlers/watcha_administration.py
  2. 10
      synapse/storage/databases/main/watcha_admin.py
  3. 3
      tests/rest/client/v1/test_watcha_administration.py

@ -25,7 +25,6 @@ class AdministrationHandler(BaseHandler):
"email_address": user["email_address"], "email_address": user["email_address"],
"display_name": user["display_name"], "display_name": user["display_name"],
"role": role, "role": role,
"status": user["status"],
"last_seen": user["last_seen"], "last_seen": user["last_seen"],
"creation_ts": user["creation_ts"], "creation_ts": user["creation_ts"],
} }

@ -314,7 +314,6 @@ class AdministrationStore(SQLBaseStore):
"display_name", "display_name",
"is_partner", "is_partner",
"is_admin", "is_admin",
"status",
"last_seen", "last_seen",
"creation_ts", "creation_ts",
] ]
@ -326,7 +325,6 @@ class AdministrationStore(SQLBaseStore):
, profiles.displayname , profiles.displayname
, users.is_partner , users.is_partner
, users.admin , users.admin
, users.deactivated
, users_last_seen.last_seen , users_last_seen.last_seen
, users.creation_ts * 1000 , users.creation_ts * 1000
FROM users FROM users
@ -357,14 +355,6 @@ class AdministrationStore(SQLBaseStore):
"watcha_user_list", watcha_user_list_txn "watcha_user_list", watcha_user_list_txn
) )
for user in users:
user["status"] = (
"inactive"
if user["status"] == 0
else "invited"
if user["user_id"] in users_with_pending_invitation
else "active"
)
return users return users
async def watcha_email_list(self): async def watcha_email_list(self):

@ -59,7 +59,6 @@ class AdministrationTestCase(unittest.HomeserverTestCase):
"email_address": "admin@example.com", "email_address": "admin@example.com",
"last_seen": None, "last_seen": None,
"role": "administrator", "role": "administrator",
"status": "invited",
"user_id": "@admin:test", "user_id": "@admin:test",
}, },
{ {
@ -68,7 +67,6 @@ class AdministrationTestCase(unittest.HomeserverTestCase):
"email_address": "collaborator@example.com", "email_address": "collaborator@example.com",
"last_seen": None, "last_seen": None,
"role": "collaborator", "role": "collaborator",
"status": "invited",
"user_id": "@collaborator:test", "user_id": "@collaborator:test",
}, },
{ {
@ -77,7 +75,6 @@ class AdministrationTestCase(unittest.HomeserverTestCase):
"email_address": "partner@example.com", "email_address": "partner@example.com",
"last_seen": None, "last_seen": None,
"role": "partner", "role": "partner",
"status": "invited",
"user_id": "@partner:test", "user_id": "@partner:test",
}, },
], ],

Loading…
Cancel
Save