Commit a121a0947c5df36d67dceb8efc15f69a0e25a885

Authored by Luan
1 parent bfffc315

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 166 cursor.execute(("INSERT INTO session_attribute "
167 167 "(sid, authenticated, name, value) "
168 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 171 [instance.username, instance.email, instance.username])
171 172  
172 173 cursor.execute(("INSERT INTO session_attribute "
173 174 "(sid, authenticated, name, value) "
174 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 178 [instance.username, instance.get_full_name(),
177 179 instance.username])
... ...