Skip to content
Snippets Groups Projects
Commit f1ce04a5 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[database][api] Fix key search in dictionaries

parent 693b387e
No related branches found
No related tags found
2 merge requests!2551.4.x,!242Py3 compatibility
......@@ -145,7 +145,7 @@ class ListTemplatesView(views.APIView):
for set_template in DatabaseSetTemplate.objects.filter(sets__protocol__database__in=databases).distinct().order_by('name'):
(db_template, dataset) = set_template.name.split('__')
if not(result.has_key(db_template)):
if db_template not in result:
result[db_template] = {
'templates': {},
'sets': [],
......@@ -208,7 +208,7 @@ class RetrieveDatabaseView(views.APIView):
# Process the query string
if request.GET.has_key('fields'):
if 'fields' in request.GET:
fields_to_return = request.GET['fields'].split(',')
else:
fields_to_return = [ 'name', 'version', 'last_version',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment