Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hardik Juneja
slapos.core
Commits
b5214887
Commit
b5214887
authored
Jul 30, 2014
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for notification_message value in case of it return None
parent
bc91cc1f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
15 deletions
+35
-15
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Computer_checkAndUpdateAllocationScope.xml
...ins/slapos_crm/Computer_checkAndUpdateAllocationScope.xml
+20
-9
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Computer_checkState.xml
...plateItem/portal_skins/slapos_crm/Computer_checkState.xml
+14
-5
master/bt5/slapos_crm/bt/revision
master/bt5/slapos_crm/bt/revision
+1
-1
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Computer_checkAndUpdateAllocationScope.xml
View file @
b5214887
...
@@ -83,15 +83,6 @@ if not is_service_provider:\n
...
@@ -83,15 +83,6 @@ if not is_service_provider:\n
request_title = \'[MONITORING] Allocation scope has been changed for %s\' % computer_reference\n
request_title = \'[MONITORING] Allocation scope has been changed for %s\' % computer_reference\n
request_description = \'Allocation scope has been changed back to \' \\\n
request_description = \'Allocation scope has been changed back to \' \\\n
\'open/personal for %s\' % computer_reference\n
\'open/personal for %s\' % computer_reference\n
message_title = \'We have changed allocation scope for %s\' % computer_reference\n
notification_reference = \'slapos-crm-computer_allocation_scope.notification\'\n
notification_message = portal.portal_notifications.getDocumentValue(\n
reference=notification_reference)\n
mapping_dict = {\'computer_title\':computer.getTitle(),\n
\'computer_id\':computer_reference,\n
\'allocation_scope\':allocation_scope}\n
message = notification_message.asText(\n
substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n
\n
support_request_url = context.Base_generateSupportRequestForSlapOS(\n
support_request_url = context.Base_generateSupportRequestForSlapOS(\n
request_title,\n
request_title,\n
...
@@ -114,6 +105,26 @@ if not is_service_provider:\n
...
@@ -114,6 +105,26 @@ if not is_service_provider:\n
# Existing ticket not found, can not create event for the moment\n
# Existing ticket not found, can not create event for the moment\n
return\n
return\n
\n
\n
# Send notification message\n
message_title = \'We have changed allocation scope for %s\' % computer_reference\n
notification_reference = \'slapos-crm-computer_allocation_scope.notification\'\n
notification_message = portal.portal_notifications.getDocumentValue(\n
reference=notification_reference)\n
if notification_message is None:\n
message = """Dear user,\n
%s.\n
Do not hesitate to visit the web forum (http://community.slapos.org/forum) in case of question.\n
\n
Regards,\n
\n
The slapos team""" % request_description\n
else:\n
mapping_dict = {\'computer_title\':computer.getTitle(),\n
\'computer_id\':computer_reference,\n
\'allocation_scope\':allocation_scope}\n
message = notification_message.asText(\n
substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n
support_request.SupportRequest_trySendNotificationMessage(message_title,\n
support_request.SupportRequest_trySendNotificationMessage(message_title,\n
message, person.getRelativeUrl())\n
message, person.getRelativeUrl())\n
</string>
</value>
</string>
</value>
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Computer_checkState.xml
View file @
b5214887
...
@@ -117,11 +117,20 @@ if should_notify:\n
...
@@ -117,11 +117,20 @@ if should_notify:\n
notification_reference = \'slapos-crm-computer_check_state.notification\'\n
notification_reference = \'slapos-crm-computer_check_state.notification\'\n
notification_message = portal.portal_notifications.getDocumentValue(\n
notification_message = portal.portal_notifications.getDocumentValue(\n
reference=notification_reference)\n
reference=notification_reference)\n
mapping_dict = {\'computer_title\':context.getTitle(),\n
if notification_message is None:\n
\'computer_id\':reference,\n
message = """Dear user,\n
\'last_contact\':last_contact}\n
%s.\n
message = notification_message.asText(\n
Do not hesitate to visit the web forum (http://community.slapos.org/forum) in case of question.\n
substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n
Regards,\n
\n
The slapos team""" % description\n
else:\n
mapping_dict = {\'computer_title\':context.getTitle(),\n
\'computer_id\':reference,\n
\'last_contact\':last_contact}\n
message = notification_message.asText(\n
substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n
\n
support_request.SupportRequest_trySendNotificationMessage(\n
support_request.SupportRequest_trySendNotificationMessage(\n
ticket_title.replace(\'[MONITORING] \', \'\'),\n
ticket_title.replace(\'[MONITORING] \', \'\'),\n
...
...
master/bt5/slapos_crm/bt/revision
View file @
b5214887
43
44
\ No newline at end of file
\ No newline at end of file
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