Commit 9b026a85 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Invert givenName and shortName in database

parent 48c8f19c
...@@ -62,6 +62,8 @@ def register_privileges(login, tokendict): ...@@ -62,6 +62,8 @@ def register_privileges(login, tokendict):
application.logger.debug(" ... is in epos fdsn map") application.logger.debug(" ... is in epos fdsn map")
fdsn_memberships.append(application.config['EPOS_FDSN_MAP'][em]) fdsn_memberships.append(application.config['EPOS_FDSN_MAP'][em])
# Now get localy defined autorizations, from email adress
if len(fdsn_memberships) == 0: if len(fdsn_memberships) == 0:
return return
...@@ -138,7 +140,7 @@ def get_login_password(tokendict): ...@@ -138,7 +140,7 @@ def get_login_password(tokendict):
expiration_time = datetime.datetime.now()+datetime.timedelta(days=1) expiration_time = datetime.datetime.now()+datetime.timedelta(days=1)
# Register login in authentication database # Register login in authentication database
cur.execute(""" cur.execute("""
INSERT INTO users VALUES (DEFAULT, %(login)s, %(givenName)s, %(sn)s, %(mail)s, %(expires_at)s); INSERT INTO users VALUES (DEFAULT, %(login)s, %s(sn)s, %(givenName)s, %(mail)s, %(expires_at)s);
""", """,
{'login': login, 'givenName': tokendict['givenName'], 'sn': tokendict['sn'], 'mail': tokendict['mail'], 'expires_at': expiration_time } {'login': login, 'givenName': tokendict['givenName'], 'sn': tokendict['sn'], 'mail': tokendict['mail'], 'expires_at': expiration_time }
) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment