Commit a121a0947c5df36d67dceb8efc15f69a0e25a885
1 parent
bfffc315
Exists in
master
and in
39 other branches
Minor fix on session attribute creation - updates #104
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
src/proxy/models.py
@@ -166,12 +166,14 @@ def change_session_attribute_email(sender, instance, **kwargs): | @@ -166,12 +166,14 @@ def change_session_attribute_email(sender, instance, **kwargs): | ||
166 | cursor.execute(("INSERT INTO session_attribute " | 166 | cursor.execute(("INSERT INTO session_attribute " |
167 | "(sid, authenticated, name, value) " | 167 | "(sid, authenticated, name, value) " |
168 | "SELECT %s, '1', 'email', %s WHERE NOT EXISTS " | 168 | "SELECT %s, '1', 'email', %s WHERE NOT EXISTS " |
169 | - "(SELECT 1 FROM session_attribute WHERE sid=%s)"), | 169 | + "(SELECT 1 FROM session_attribute WHERE sid=%s " |
170 | + "AND name='email')"), | ||
170 | [instance.username, instance.email, instance.username]) | 171 | [instance.username, instance.email, instance.username]) |
171 | 172 | ||
172 | cursor.execute(("INSERT INTO session_attribute " | 173 | cursor.execute(("INSERT INTO session_attribute " |
173 | "(sid, authenticated, name, value) " | 174 | "(sid, authenticated, name, value) " |
174 | "SELECT %s, '1', 'name', %s WHERE NOT EXISTS " | 175 | "SELECT %s, '1', 'name', %s WHERE NOT EXISTS " |
175 | - "(SELECT 1 FROM session_attribute WHERE sid=%s)"), | 176 | + "(SELECT 1 FROM session_attribute WHERE sid=%s " |
177 | + "AND name='name')"), | ||
176 | [instance.username, instance.get_full_name(), | 178 | [instance.username, instance.get_full_name(), |
177 | instance.username]) | 179 | instance.username]) |