Changement de nom de table SQL

This commit is contained in:
Emmanuel Garette 2020-09-05 16:41:30 +02:00
parent 32b83f496b
commit a12e679b3c
3 changed files with 7 additions and 7 deletions

View File

@ -294,7 +294,7 @@ class Dispatcher(register.RegisterDispatcher,
# Verify if user exists and get ID # Verify if user exists and get ID
sql = ''' sql = '''
SELECT UserId SELECT UserId
FROM RisottoUser FROM UserUser
WHERE UserLogin = $1 WHERE UserLogin = $1
''' '''
user_id = await connection.fetchval(sql, user_id = await connection.fetchval(sql,
@ -312,8 +312,8 @@ class Dispatcher(register.RegisterDispatcher,
# Check role # Check role
select_role_uri = ''' select_role_uri = '''
SELECT RoleName SELECT RoleName
FROM URI, RoleURI FROM UserURI, UserRoleURI
WHERE URI.URIName = $1 AND RoleURI.URIId = URI.URIId WHERE UserURI.URIName = $1 AND UserRoleURI.URIId = UserURI.URIId
''' '''
select_role_user = ''' select_role_user = '''
SELECT RoleAttribute, RoleAttributeValue SELECT RoleAttribute, RoleAttributeValue

View File

@ -109,9 +109,9 @@ async def api(request,
async with connection.transaction(): async with connection.transaction():
# Check role with ACL # Check role with ACL
sql = ''' sql = '''
SELECT URI.URIName SELECT UserURI.URIName
FROM URI, RoleURI FROM UserURI, UserRoleURI
WHERE RoleURI.URIId = URI.URIId WHERE UserRoleURI.URIId = UserURI.URIId
''' '''
uris = [uri['uriname'] for uri in await connection.fetch(sql)] uris = [uri['uriname'] for uri in await connection.fetch(sql)]
risotto_modules = services.get_services_list() risotto_modules = services.get_services_list()

View File

@ -413,7 +413,7 @@ def load_customtypes() -> None:
custom_type = CustomType(load(message_file, Loader=SafeLoader)) custom_type = CustomType(load(message_file, Loader=SafeLoader))
ret[version][custom_type.getname()] = custom_type ret[version][custom_type.getname()] = custom_type
except Exception as err: except Exception as err:
raise Exception(_(f'enable to load type {err}: {message}')) raise Exception(_(f'enable to load type "{message}": {err}'))
return ret return ret