Commit 391e50f7 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: lint

parent 308f2678
Pipeline #10857 failed with stage
in 0 seconds
......@@ -3,14 +3,14 @@ grade = context.Base_getServiceLevelObjectGrade(slo, value)
return grade
# Report seems not able to render HTML
color_dict = {
"A": "lightgreen",
"B": "green",
"C": "blue",
"D": "orange",
"E": "red",
"F": "red",
}
for g, color in color_dict.iteritems():
if grade.startswith(g):
return "<font color='%s'>%s</font>" % (color, grade)
# color_dict = {
# "A": "lightgreen",
# "B": "green",
# "C": "blue",
# "D": "orange",
# "E": "red",
# "F": "red",
# }
# for g, color in color_dict.iteritems():
# if grade.startswith(g):
# return "<font color='%s'>%s</font>" % (color, grade)
from DateTime import DateTime
import json
portal = context.getPortalObject()
from Products.ERP5Type.Document import newTempDocument
from Products.ERP5Type.Document import newTempBase
public_category_uid = portal.restrictedTraverse(
"portal_categories/allocation_scope/open/public", None).getUid()
......@@ -78,7 +78,7 @@ for computer in portal.portal_catalog(
instance_error_ratio = float(instance_error_count)/instance_count
l.append(
newTempDocument(context, '%s'% computer.id, **{"title": computer.title,
newTempBase(context, '%s'% computer.id, **{"title": computer.title,
"uid": "%s_%s" % (computer.getUid(), instance_count),
"reference": computer.reference,
"partition_use_ratio": partition_use_ratio,
......
......@@ -2,9 +2,9 @@ portal = context.getPortalObject()
uid_list = [context.getUid()]
for instance in portal.portal_catalog(
portal_type="Software Instance",
default_aggregate_uid=[cp.uid for cp in context.searchFolder(portal_type="Computer Partition")]):
uid_list.append(instance.getSpecialiseUid(portal_type="Hosting Subscription"))
portal_type="Software Instance",
default_aggregate_uid=[cp.uid for cp in context.searchFolder(portal_type="Computer Partition")]):
uid_list.append(instance.getSpecialiseUid(portal_type="Hosting Subscription"))
return portal.portal_catalog(
portal_type='Support Request',
......
portal = context.getPortalObject()
from Products.ERP5Type.Document import newTempDocument
from Products.ERP5Type.Document import newTempBase
kw = {}
kw["portal_type"] = "Hosting Subscription"
......@@ -39,7 +39,7 @@ document_list = []
for person_relative_url in l:
person = portal.restrictedTraverse(person_relative_url)
document_list.append(
newTempDocument(context.person_module, person.getId(),
newTempBase(context.person_module, person.getId(),
uid = "t_%s" % person.getUid(), title=person.getTitle(),
**l[person_relative_url]))
......
from DateTime import DateTime
from Products.ERP5Type.Document import newTempDocument
from Products.ERP5Type.Document import newTempBase
portal = context.getPortalObject()
......@@ -37,7 +37,7 @@ creation_date_list = list(date_set)
creation_date_list.sort()
for creation_date in creation_date_list:
line = newTempDocument(context, '%s' % creation_date.replace("/", "_"), **{
line = newTempBase(context, '%s' % creation_date.replace("/", "_"), **{
"uid": "%s_%s" % (context.getUid(), len(stats_list)),
"title": creation_date,
"hosting_subscription_quantity" : countDocument(creation_date, "Hosting Subscription"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment