Added the account primary key to the search query in the accounting application.

This commit is contained in:
依瑪貓 2020-09-04 19:36:32 +08:00
parent 00180d28b9
commit 70d725d2af

View File

@ -783,7 +783,8 @@ def search(request: HttpRequest) -> HttpResponse:
if re.match("^[0-9]{9}$", query):
conditions = conditions\
| Q(pk=int(query))\
| Q(transaction__pk=int(query))
| Q(transaction__pk=int(query))\
| Q(account__pk=int(query))
if re.match("^[0-9]{4}$", query):
conditions = conditions\
| Q(transaction__date__year=int(query))