3737from auth_api .models .dataclass import Activity , DeleteAffiliationRequest
3838from auth_api .models .org import OrgSearch
3939from auth_api .schemas import ContactSchema , InvitationSchema , MembershipSchema , OrgSchema
40+ from auth_api .services .flags import flags
4041from auth_api .services .user import User as UserService
4142from auth_api .services .validators .access_type import validate as access_type_validate
4243from auth_api .services .validators .account_limit import validate as account_limit_validate
@@ -107,6 +108,7 @@ def create_org(org_info: dict, user_id):
107108 mailing_address = org_info .pop ("mailingAddress" , None )
108109 payment_info = org_info .pop ("paymentInfo" , {})
109110 product_subscriptions = org_info .pop ("productSubscriptions" , None )
111+ type_code = org_info .get ("typeCode" , None )
110112
111113 bcol_profile_flags = None
112114 response = Org ._validate_and_raise_error (org_info )
@@ -119,7 +121,10 @@ def create_org(org_info: dict, user_id):
119121 access_type = response .get ("access_type" )
120122
121123 # set premium for GOVM accounts..TODO remove if not needed this logic
122- if access_type == AccessType .GOVM .value :
124+ # we are depreciating BASIC accounts
125+ if access_type == AccessType .GOVM .value or (
126+ type_code == OrgType .BASIC .value and flags .is_on ("remove-premium-restrictions" , default = False ) is True
127+ ):
123128 org_info .update ({"typeCode" : OrgType .PREMIUM .value })
124129
125130 org = OrgModel .create_from_dict (camelback2snake (org_info ))
0 commit comments