Skip to content

Commit e4268dc

Browse files
Staging into Master (#93)
2 parents 32a2347 + c5c6e14 commit e4268dc

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

backend/valifn/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.11.0"
1+
__version__ = "1.12.0-release-candidate-1706712667"

templates/childrensuspectwarning.py

+23-16
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"""
88

99
__author__ = "Gonçalo Ivo"
10-
__copyright__ = "Copyright 2022, Valispace"
10+
__copyright__ = "Copyright 2024, Valispace"
1111
__credits__ = ["Gonçalo Ivo"]
1212
__license__ = "GPL"
13-
__version__ = "1.1"
13+
__version__ = "1.2"
1414
__maintainer__ = "Valispace"
1515
__email__ = "support@valispace.com"
1616
__status__ = "Development"
@@ -29,13 +29,13 @@
2929
from xmlrpc.client import Boolean
3030

3131
VALISPACE = {
32-
'domain': 'https://.valispace.com/',
33-
'username': Username,
34-
'password': Password
32+
'domain': 'https://deployment_name.valispace.com/',
33+
'username': '',
34+
'password': ''
3535
}
3636

3737
DEFAULT_VALUES = {
38-
"project": 24,
38+
"project": PROJECT_ID,
3939
}
4040

4141

@@ -71,23 +71,30 @@ def main(**kwargs):
7171
)
7272

7373
all_deployment_users = get_map(api, f"user/", "id")
74-
75-
#it get the triggered object (in this case a requirement)
74+
all_project_requirements = get_map(api, f"requirements/?project="+str(DEFAULT_VALUES['project']), "id")
7675
requirement_data = kwargs['triggered_objects'][0]
77-
print(requirement_data)
78-
79-
user_changing_req = all_deployment_users[requirement_data['updated_by']]
80-
username = user_changing_req['first_name']+" "+user_changing_req['last_name']
81-
user = f"<span class=\"quill-autocomplete\" host=\"user\" itemid=\"{user_changing_req['id']}\" name=\"{username}\" field=\"displayName\"><user editable=\"true\" itemid=\"{user_changing_req['id']}\" field=\"displayName\">@{username}</user></span>"
82-
requirement = f"<span class=\"quill-autocomplete\" host=\"requirement\" itemid=\"{requirement_data['id']}\" name=\"{requirement_data['identifier']}\" field=\"identifier\"><requirement editable=\"true\" itemid=\"{requirement_data['id']}\" field=\"identifier\">${requirement_data['identifier']}</requirement></span>"
8376

77+
#requirement_data = api.get('requirements/90') #just for testing now without automation to receive the trigger object
78+
79+
print(requirement_data)
8480
print(requirement_data["children"])
8581
req_children = requirement_data["children"]
8682
if len(req_children)>0:
87-
for children in req_children:
83+
user_changing_req = all_deployment_users[requirement_data['updated_by']]
84+
username = user_changing_req['first_name']+" "+user_changing_req['last_name']
85+
requirement = f"<span class=\"quill-autocomplete\" host=\"requirement\" itemid=\"{requirement_data['id']}\" name=\"{requirement_data['identifier']}\" field=\"identifier\"><requirement editable=\"true\" itemid=\"{requirement_data['id']}\" field=\"identifier\">${requirement_data['identifier']}</requirement></span>"
8886

87+
for children in req_children:
88+
print(all_project_requirements[children])
89+
if all_project_requirements[children]['owner'] != None:
90+
user_owner = all_deployment_users[all_project_requirements[children]['owner']['id']]
91+
ownername = user_owner['first_name']+" "+user_owner['last_name']
92+
user = f"<span class=\"quill-autocomplete\" host=\"user\" itemid=\"{user_owner['id']}\" name=\"{ownername}\" field=\"displayName\"><user editable=\"true\" itemid=\"{user_owner['id']}\" field=\"displayName\">@{ownername}</user></span>"
93+
else:
94+
user = f"<span class=\"quill-autocomplete\" host=\"user\" itemid=\"{user_changing_req['id']}\" name=\"{username}\" field=\"displayName\"><user editable=\"true\" itemid=\"{user_changing_req['id']}\" field=\"displayName\">@{username}</user></span>"
95+
8996
discussionData = {
90-
"title" : user + " made and update to Parent "+ requirement,
97+
"title" : user + " -> The Parent "+ requirement + " of this requirement was updated",
9198
"project": DEFAULT_VALUES["project"],
9299
"content_type" : 120,
93100
"group": 1,

0 commit comments

Comments
 (0)