Bläddra i källkod

Add where clause only if conditions exists (#3853)

version-14
Nabin Hait 8 år sedan
committed by Rushabh Mehta
förälder
incheckning
b524d892f7
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. +3
    -2
      frappe/database.py

+ 3
- 2
frappe/database.py Visa fil

@@ -600,8 +600,9 @@ class Database:

order_by = ("order by " + order_by) if order_by else ""

r = self.sql("select {0} from `tab{1}` where {2} {3}".format(fl, doctype,
conditions, order_by), values, as_dict=as_dict, debug=debug, update=update)
r = self.sql("select {0} from `tab{1}` {2} {3} {4}"
.format(fl, doctype, "where" if conditions else "", conditions, order_by), values,
as_dict=as_dict, debug=debug, update=update)

return r



Laddar…
Avbryt
Spara