Skip to content

Commit 2791728

Browse files
Fixed default filters, made tier2 optional.
1 parent a76127f commit 2791728

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

connect/models/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def make_object(self, data):
502502
class TierAccountsSchema(Schema):
503503
customer = fields.Nested(TierAccountSchema)
504504
tier1 = fields.Nested(TierAccountSchema)
505-
tier2 = fields.Nested(TierAccountSchema)
505+
tier2 = fields.Nested(TierAccountSchema, allow_none=True)
506506

507507
@post_load
508508
def make_object(self, data):

connect/models/tier_accounts.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# This file is part of the Ingram Micro Cloud Blue Connect SDK.
44
# Copyright (c) 2019 Ingram Micro. All Rights Reserved.
55

6+
from typing import Optional
7+
68
from .base import BaseModel
79
from .tier_account import TierAccount
810
from .schemas import TierAccountsSchema
@@ -19,5 +21,5 @@ class TierAccounts(BaseModel):
1921
tier1 = None # type: TierAccount
2022
""" (:py:class:`.TierAccount`) Level 1 TierAccount Object. """
2123

22-
tier2 = None # type: TierAccount
23-
""" (:py:class:`.TierAccount`) Level 2 TierAccount Object. """
24+
tier2 = None # type: Optional[TierAccount]
25+
""" (:py:class:`.TierAccount` | None) Level 2 TierAccount Object. """

connect/resources/tier_config_automation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def filters(self, status='pending', **kwargs):
5858
"""
5959
filters = super(TierConfigAutomation, self).filters(status=status, **kwargs)
6060
if self.config.products:
61-
filters['asset.product.id__in'] = ','.join(self.config.products)
61+
filters['configuration__product__id'] = ','.join(self.config.products)
6262
return filters
6363

6464
@function_log

0 commit comments

Comments
 (0)