Procházet zdrojové kódy

Add where clause only if conditions exists (#3853)

version-14
Nabin Hait před 8 roky
committed by Rushabh Mehta
rodič
revize
b524d892f7
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. +3
    -2
      frappe/database.py

+ 3
- 2
frappe/database.py Zobrazit soubor

@@ -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



Načítá se…
Zrušit
Uložit