Skip to content

Commit a4c8499

Browse files
committed
outcall: generate name using a fake UUID
Why: outcalls do not use UUIDs yet
1 parent ed3d030 commit a4c8499

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

wazo_confd/plugins/outcall/resource.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

44
from flask import request, url_for
5+
from uuid import uuid4
56

67
from xivo_dao.alchemy.outcall import Outcall
78

@@ -14,7 +15,7 @@
1415
class OutcallList(ListResource):
1516
model = Outcall
1617
schema = OutcallSchema
17-
outcall_name_fmt = 'outcall-{tenant_slug}-{outcall_id}'
18+
outcall_name_fmt = 'outcall-{tenant_slug}-{outcall_uuid}'
1819

1920
def __init__(self, tenant_dao, *args, **kwargs):
2021
super().__init__(*args, **kwargs)
@@ -29,9 +30,11 @@ def post(self):
2930
form = self.add_tenant_to_form(form)
3031

3132
tenant = self._tenant_dao.get(form['tenant_uuid'])
33+
# NOTE(afournier): we use a UUID as if it was the outcall UUID but it's not
34+
# Outcalls do not use UUIDs yet
3235
form['name'] = self.outcall_name_fmt.format(
3336
tenant_slug=tenant.slug,
34-
outcall_id=form['id'],
37+
outcall_uuid=uuid4(),
3538
)
3639
model = self.model(**form)
3740
model = self.service.create(model)

0 commit comments

Comments
 (0)