Skip to content

Commit 559fc36

Browse files
committed
fix: Устранение ошибки keyerror
1 parent ef7619d commit 559fc36

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/handlers/reserve_admin_hl.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -181,23 +181,11 @@ async def start_forma_info(
181181
reserve_user_data
182182
)
183183

184-
common_data = context.user_data['common_data']
185-
common_data['dict_of_shows'].clear()
186-
187-
reserve_user_data = context.user_data['reserve_user_data']
188184
reserve_user_data['chose_price'] = price
189-
if context.user_data.get('dict_of_name_show', False):
190-
reserve_user_data['dict_of_name_show'].clear()
191-
if context.user_data.get('dict_of_name_show_flip', False):
192-
reserve_user_data['dict_of_name_show_flip'].clear()
193-
if context.user_data.get('dict_of_date_show', False):
194-
reserve_user_data['dict_of_date_show'].clear()
195-
reserve_user_data['back'].clear()
196-
197-
reserve_admin_data = context.user_data['reserve_admin_data']
198185
payment_id = reserve_admin_data['payment_id']
199186
reserve_admin_data[payment_id]['chose_ticket'] = chose_ticket
200187
event_id = reserve_admin_data[payment_id]['event_id']
188+
201189
list_of_name_colum = [
202190
'qty_child_free_seat',
203191
'qty_adult_free_seat',
@@ -227,6 +215,17 @@ async def start_forma_info(
227215
parse_mode=ParseMode.HTML
228216
)
229217

218+
if common_data.get('dict_of_shows', False):
219+
common_data['dict_of_shows'].clear()
220+
if reserve_user_data.get('dict_of_name_show', False):
221+
reserve_user_data['dict_of_name_show'].clear()
222+
if reserve_user_data.get('dict_of_name_show_flip', False):
223+
reserve_user_data['dict_of_name_show_flip'].clear()
224+
if reserve_user_data.get('dict_of_date_show', False):
225+
reserve_user_data['dict_of_date_show'].clear()
226+
if reserve_user_data.get('dict_of_date_show', False):
227+
reserve_user_data['back'].clear()
228+
230229
state = 'FORMA'
231230
context.user_data['STATE'] = state
232231
return state

0 commit comments

Comments
 (0)