File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ async def async_step_mfa(
136
136
for contract in contracts
137
137
if contract .status == 1
138
138
]
139
- if len (contract_ids ) == 1 :
139
+ if len (contract_ids ) == 0 :
140
+ errors ["base" ] = "no_active_contracts"
141
+ elif len (contract_ids ) == 1 :
140
142
data [CONF_SELECTED_CONTRACTS ] = [contract_ids [0 ]]
141
143
return self ._async_create_iec_entry (data )
142
144
else :
Original file line number Diff line number Diff line change 99
99
"cannot_connect" : " [%key:common::config_flow::error::cannot_connect%]" ,
100
100
"invalid_auth" : " [%key:common::config_flow::error::invalid_auth%]" ,
101
101
"invalid_id" : " Invalid Israeli ID" ,
102
- "no_contracts" : " You should select at least one contract"
102
+ "no_contracts" : " You should select at least one contract" ,
103
+ "no_active_contracts" : " No active contracts found"
103
104
},
104
105
"abort" : {
105
106
"already_configured" : " [%key:common::config_flow::abort::already_configured_service%]" ,
Original file line number Diff line number Diff line change 102
102
"cannot_connect" : " [%key:common::config_flow::error::cannot_connect%]" ,
103
103
"invalid_auth" : " [%key:common::config_flow::error::invalid_auth%]" ,
104
104
"invalid_id" : " תעודת זהות לא תקנית" ,
105
- "no_contracts" : " נא לבחור לפחות חוזה אחד"
105
+ "no_contracts" : " נא לבחור לפחות חוזה אחד" ,
106
+ "no_active_contracts" : " לא נמצאו חוזים פעילים"
106
107
},
107
108
"abort" : {
108
109
"already_configured" : " [%key:common::config_flow::abort::already_configured_service%]" ,
You can’t perform that action at this time.
0 commit comments