提交 1e0fcfce 编写于 作者: P Pzqqt

wuliu: forms: CargoPricePaymentSearchForm: Fix wrong search field name

Exception:
Url: /tms/finance/cargo_price_payment/manage
Method: POST
Post data: {'csrfmiddlewaretoken': '???', 'create_user': '', 'create_department': '', 'payee_name': '', 'status': '4', 'create_date_start': '', 'create_date_end': '', 'settle_accounts_date_start': '', 'settle_accounts_date_end': ''}

Traceback (most recent call last):
  File "C:\Users\Pzqqt\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "C:\Users\Pzqqt\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "E:\Python\PPWuLiu\wuliu\common.py", line 76, in login_check
    return func(request, *args, **kwargs)
  File "E:\Python\PPWuLiu\wuliu\common.py", line 89, in perm_check
    return func(request, *args, **kwargs)
  File "E:\Python\PPWuLiu\wuliu\views.py", line 1365, in manage_cargo_price_payment
    department_payment_list = form.gen_cargo_price_payment_list_to_queryset()
  File "E:\Python\PPWuLiu\wuliu\forms.py", line 1026, in gen_cargo_price_payment_list_to_queryset
    elif form_dic["settle_accounts_start"] or form_dic["settle_accounts_end"]:
KeyError: 'settle_accounts_start'
上级 f4f0905d
......@@ -1023,7 +1023,7 @@ class CargoPricePaymentSearchForm(_FormBase):
timezone.datetime.combine(create_date_end, datetime_.time(23, 59, 59))
),
)
elif form_dic["settle_accounts_start"] or form_dic["settle_accounts_end"]:
elif form_dic["settle_accounts_date_start"] or form_dic["settle_accounts_date_end"]:
settle_accounts_date_start = form_dic["settle_accounts_date_start"] or DATA_MIN
settle_accounts_date_end = form_dic["settle_accounts_date_end"] or datetime_.date.today()
r_queryset = r_queryset.filter(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册