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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
9d5e1370
Commit
9d5e1370
authored
Feb 21, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: block services if user must pay his invoices
parent
39bbf5c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Item_getSubscriptionStatus.py
...m/portal_skins/slapos_cloud/Item_getSubscriptionStatus.py
+28
-2
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Item_getSubscriptionStatus.py
View file @
9d5e1370
item
=
context
item
=
context
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
if
(
item
.
getPortalType
()
==
'Instance Tree'
)
and
(
item
.
getSlapState
()
==
"destroy_requested"
)
:
if
item
.
getValidationState
()
in
[
'invalidated'
,
'archived'
]
:
return
'todestroy'
return
'todestroy'
# If no open order, subscription must be approved
# If no open order, subscription must be approved
...
@@ -15,7 +15,33 @@ open_sale_order_movement_list = portal.portal_catalog(
...
@@ -15,7 +15,33 @@ open_sale_order_movement_list = portal.portal_catalog(
if
len
(
open_sale_order_movement_list
)
==
0
:
if
len
(
open_sale_order_movement_list
)
==
0
:
return
"not_subscribed"
return
"not_subscribed"
# Check if there are some ongoing Regularisation Request
ion
# Check if there are some ongoing Regularisation Request
# if so, return to_pay
# if so, return to_pay
entity_uid
=
None
item_portal_type
=
item
.
getPortalType
()
if
item_portal_type
==
'Instance Tree'
:
entity_uid
=
item
.
getDestinationSectionUid
()
elif
item_portal_type
==
'Project'
:
entity_uid
=
item
.
getDestinationUid
()
elif
item_portal_type
==
'Compute Node'
:
project
=
item
.
getFollowUpValue
()
if
project
is
not
None
:
entity_uid
=
project
.
getDestinationUid
()
else
:
raise
NotImplementedError
(
'Unsupported item %s'
%
item
.
getRelativeUrl
())
regularisation_request_list
=
portal
.
portal_catalog
(
portal_type
=
'Regularisation Request'
,
destination__uid
=
entity_uid
or
-
1
,
simulation_state
=
'suspended'
,
resource__uid
=
[
portal
.
service_module
.
slapos_crm_stop_acknowledgement
.
getUid
(),
portal
.
service_module
.
slapos_crm_delete_reminder
.
getUid
(),
portal
.
service_module
.
slapos_crm_delete_acknowledgement
.
getUid
(),
],
limit
=
1
)
if
len
(
regularisation_request_list
)
==
1
:
return
"to_pay"
return
"subscribed"
return
"subscribed"
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