fix(get_last_doc): Allow for_update as kwarg only

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
gavin 2022-07-22 13:34:04 +05:30 committed by GitHub
parent d1fbab1c45
commit f40214bca8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1182,7 +1182,7 @@ def get_doc(*args, **kwargs) -> "Document":
return doc
def get_last_doc(doctype, filters=None, order_by="creation desc", for_update=False):
def get_last_doc(doctype, filters=None, order_by="creation desc", *, for_update=False):
"""Get last created document of this type."""
d = get_all(doctype, filters=filters, limit_page_length=1, order_by=order_by, pluck="name")
if d: