Commit 00b36b25 authored by Etienne Allovon's avatar Etienne Allovon

Merge branch '2980-fix-agent-listing-agentid' into 'master'

2980 fix agent listing agentid

See merge request !59
parents 5b67310b e6d25a31
xivo-dao (2019.12.07) xivo-deneb; urgency=medium
* 2989 Include agentid in user search api
-- Jean-Pierre Thomasset <[email protected]> Wed, 20 Nov 2019 08:43:26 +0000
xivo-dao (2019.12.06) xivo-deneb; urgency=medium
* 2954 Disabled extensions are still generated in the dialplan
......
......@@ -21,7 +21,7 @@ class UserModel(object):
caller_id, outgoing_caller_id, mobile_phone_number, username, password,
music_on_hold, preprocess_subroutine, userfield,
call_transfer_enabled, call_record_enabled, online_call_record_enabled, supervision_enabled,
ring_seconds, simultaneous_calls, call_permission_password, agent_number, agent_group_id, enabled):
ring_seconds, simultaneous_calls, call_permission_password, agent_number, agentid, agent_group_id, enabled):
self.id = id
self.uuid = uuid
self.firstname = firstname
......@@ -46,6 +46,7 @@ class UserModel(object):
self.simultaneous_calls = simultaneous_calls
self.call_permission_password = call_permission_password
self.agent_number = agent_number
self.agentid = agentid
self.agent_group_id = agent_group_id
self.enabled = enabled
......
......@@ -48,7 +48,8 @@ config = SearchConfig(table=UserFeatures,
'exten': Extension.exten,
'extension': Extension.exten,
'context': Extension.context,
'enabled': UserFeatures.enabled},
'enabled': UserFeatures.enabled,
'agentid': UserFeatures.agentid},
search=['fullname',
'caller_id',
'description',
......
......@@ -365,6 +365,7 @@ class TestSimpleSearch(TestSearch):
call_permission_password=None,
agent_number=None,
agent_group_id=None,
agentid=None,
enabled=True)
expected = SearchResult(1, [expected_user_m])
......@@ -420,6 +421,7 @@ class TestSimpleSearch(TestSearch):
call_permission_password='4321',
agent_number=None,
agent_group_id=None,
agentid=None,
enabled=True)
expected = SearchResult(1, [excpected_user_m])
......@@ -456,6 +458,7 @@ class TestSimpleSearch(TestSearch):
call_permission_password=None,
agent_number='8000',
agent_group_id=2,
agentid=agent_row.id,
enabled=True)
expected = SearchResult(1, [expected_user_m])
......
......@@ -62,6 +62,7 @@ class UserView(View):
case([(User.commented == 0, True)],
else_=False).label('enabled'),
func.nullif(AgentFeatures.number, '').label('agent_number'),
User.agentid.label('agentid'),
AgentFeatures.numgroup.label('agent_group_id')))
return query
......@@ -90,6 +91,7 @@ class UserView(View):
simultaneous_calls=row.simultaneous_calls,
call_permission_password=row.call_permission_password,
agent_number=row.agent_number,
agentid=row.agentid,
agent_group_id=row.agent_group_id,
enabled=row.enabled)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment