Finalize skill_gid in skills manifest.

Before sending the skills manifest to the backend attach device uuid as needed.
pull/2104/head
Åke Forslund 2019-05-21 17:47:12 +02:00
parent c3ac9d8ca7
commit 716c16a027
1 changed files with 5 additions and 0 deletions

View File

@ -371,6 +371,11 @@ class DeviceApi(Api):
skills = {s['name']: s for s in data['skills']}
to_send['skills'] = [skills[key] for key in skills]
# Finalize skill_gid with uuid if needed
for s in to_send['skills']:
s['skill_gid'] = s.get('skill_gid', '').replace(
'@|', '@{}|'.format(self.identity.uuid))
self.request({
"method": "PUT",
"path": "/" + self.identity.uuid + "/skillJson",