Selaa lähdekoodia

fix: remove tab \t and newlines \n from start of query and remove from middle

(cherry picked from commit ac5effc7dd)

# Conflicts:
#	frappe/database/database.py
version-14
Shariq Ansari 3 vuotta sitten
committed by mergify-bot
vanhempi
commit
b2c0bf7a4e
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. +6
    -0
      frappe/database/database.py

+ 6
- 0
frappe/database/database.py Näytä tiedosto

@@ -116,8 +116,14 @@ class Database(object):

"""
query = str(query)
<<<<<<< HEAD
if not run:
return query
=======

# remove \n \t from start of query and replace them with space anywhere in middle
query = re.sub(r'\s', ' ', query).lstrip()
>>>>>>> ac5effc7dd (fix: remove tab \t and newlines \n from start of query and remove from middle)

if re.search(r'ifnull\(', query, flags=re.IGNORECASE):
# replaces ifnull in query with coalesce


Ladataan…
Peruuta
Tallenna