Implement handling of empty temp_num_prefix
This commit is contained in:
parent
c75164e013
commit
f10fa3e169
1 changed files with 4 additions and 1 deletions
|
|
@ -30,6 +30,8 @@ class Dect:
|
|||
return None
|
||||
|
||||
def load_temp_extensions(self):
|
||||
if self.temp_num_prefix is None:
|
||||
return
|
||||
used_temp_extensions = self.c.find_users(lambda u: u.num.startswith(self.temp_num_prefix))
|
||||
for u in used_temp_extensions:
|
||||
temp_num = u.num
|
||||
|
|
@ -85,7 +87,8 @@ class Dect:
|
|||
# user in OMM, but no DECT extension in configuration
|
||||
if not e:
|
||||
# the user might have a temporary extension assigned, collect it
|
||||
if user.num.startswith(next(self.fp.extensions.extensions_by_type("temp")).num):
|
||||
temp_extension = self.temp_num_prefix
|
||||
if temp_extension is not None and user.num.startswith(temp_extension):
|
||||
users_by_ext[user.num] = user
|
||||
users_by_uid[user.uid] = user
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue