Revised the regular expression to query by the random primary key in the accounting application.
This commit is contained in:
parent
7f8375bfe7
commit
b6a5bc3166
@ -780,7 +780,7 @@ def search(request: HttpRequest) -> HttpResponse:
|
|||||||
| Q(transaction__notes__icontains=query)
|
| Q(transaction__notes__icontains=query)
|
||||||
if re.match("^[0-9]+(?:\\.[0-9]+)?$", query):
|
if re.match("^[0-9]+(?:\\.[0-9]+)?$", query):
|
||||||
conditions = conditions | Q(amount=Decimal(query))
|
conditions = conditions | Q(amount=Decimal(query))
|
||||||
if re.match("^[0-9]{9}$", query):
|
if re.match("^[1-9][0-8]{9}$", query):
|
||||||
conditions = conditions\
|
conditions = conditions\
|
||||||
| Q(pk=int(query))\
|
| Q(pk=int(query))\
|
||||||
| Q(transaction__pk=int(query))\
|
| Q(transaction__pk=int(query))\
|
||||||
|
Loading…
Reference in New Issue
Block a user