Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
X
xivo-dao
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xivo.solutions
xivo-dao
Commits
fe0462bd
Commit
fe0462bd
authored
Nov 05, 2019
by
Vojtech Sodoma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2936 Generate only enabled users in dialplan
parent
7f76a406
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
xivo_dao/asterisk_conf_dao.py
xivo_dao/asterisk_conf_dao.py
+3
-1
xivo_dao/tests/test_asterisk_conf_dao.py
xivo_dao/tests/test_asterisk_conf_dao.py
+12
-0
No files found.
xivo_dao/asterisk_conf_dao.py
View file @
fe0462bd
...
...
@@ -334,10 +334,12 @@ def _find_user_exten_settings(session, context_name):
UserLine
.
main_user
==
True
,
UserLine
.
main_line
==
True
))
.
join
(
LineFeatures
,
LineFeatures
.
id
==
UserLine
.
line_id
)
.
join
(
UserFeatures
,
UserFeatures
.
id
==
UserLine
.
user_id
)
.
filter
(
and_
(
Extension
.
context
==
context_name
,
Extension
.
commented
==
0
,
Extension
.
type
==
'user'
,
LineFeatures
.
commented
==
0
))
LineFeatures
.
commented
==
0
,
UserFeatures
.
commented
==
0
))
.
order_by
(
Extension
.
exten
)
.
all
())
...
...
xivo_dao/tests/test_asterisk_conf_dao.py
View file @
fe0462bd
...
...
@@ -590,6 +590,18 @@ class TestAsteriskConfDAO(DAOTestCase, PickupHelperMixin):
assert_that
(
result
,
contains
())
def
test_find_exten_settings_when_user_disabled
(
self
):
user_row
=
self
.
add_user
(
commented
=
1
)
line_row
=
self
.
add_line
()
extension_row
=
self
.
add_extension
(
exten
=
'14'
,
context
=
'default'
)
self
.
add_user_line
(
user_id
=
user_row
.
id
,
extension_id
=
extension_row
.
id
,
line_id
=
line_row
.
id
)
result
=
asterisk_conf_dao
.
find_exten_settings
(
'default'
)
assert_that
(
result
,
contains
())
def
test_find_exten_settings_multiple_extensions
(
self
):
user1
=
self
.
add_user
()
line1
=
self
.
add_line
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment