From 662ffb0a82051713912ba63e3975505226943a1e Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Mon, 7 Dec 2015 22:02:24 +0100 Subject: [PATCH] Fixed little bug --- cromosoma/usermodel.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cromosoma/usermodel.py b/cromosoma/usermodel.py index 3ec4ff8..1d06acd 100644 --- a/cromosoma/usermodel.py +++ b/cromosoma/usermodel.py @@ -98,25 +98,25 @@ class UserModel(WebModel): if self.username_field in dict_values: - self.conditions=['WHERE username=%s', [dict_values[self.username_field]]] + self.conditions=['WHERE (username=%s', [dict_values[self.username_field]]] if self.email_field in dict_values: if len(self.conditions[1])>0: - self.conditions[0]+=' OR email=%s' + self.conditions[0]+=' OR email=%s)' else: - self.conditions[0]='WHERE email=%s' + self.conditions[0]='WHERE (email=%s)' self.conditions[1]=[] self.conditions[1].append([dict_values[self.email_field]]) if get_id>0: - self.conditions[0]=' AND '+self.username_field+'=%s' + self.conditions[0]+=' AND '+self.name_field_id+'!=%s' self.conditions[1].append(get_id) - + print(self.conditions[0]) if self.select_count()>0: self.fields[self.username_field].error=True