From fe909090635fa288e6f1bad95280876150ac295c Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Thu, 26 Apr 2018 15:50:11 +0200
Subject: [PATCH] [plotters][api] Fix key search in dictionaries

---
 beat/web/plotters/api.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/beat/web/plotters/api.py b/beat/web/plotters/api.py
index ba9cbd2f0..2dd32f4c1 100644
--- a/beat/web/plotters/api.py
+++ b/beat/web/plotters/api.py
@@ -281,14 +281,14 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
                 raise serializers.ValidationError({'data': 'Empty'})
 
 
-        if data.has_key('short_description'):
+        if 'short_description' in data:
             if not(isinstance(data['short_description'], six.string_types)):
                 raise serializers.ValidationError({'short_description', 'Invalid short_description data'})
             short_description = data['short_description']
         else:
             short_description = None
 
-        if data.has_key('description'):
+        if 'description' in data:
             if not(isinstance(data['description'], six.string_types)):
                 raise serializers.ValidationError({'description': 'Invalid description data'})
             description = data['description']
@@ -299,13 +299,13 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
         else:
             description = None
 
-        if data.has_key('strict'):
+        if 'strict' in data:
             strict = data['strict']
         else:
             strict = True
 
         plotter = None
-        if data.has_key('plotter'):
+        if 'plotter' in data:
             try:
                 if isinstance(data['plotter'], int):
                     plotter = Plotter.objects.get(id=data['plotter'])
@@ -318,11 +318,11 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
             raise serializers.ValidationError({'short_description': 'Short description too long'})
 
         customdata = None
-        if data.has_key('customdata'):
+        if 'customdata' in data:
             customdata = json.dumps(data['customdata'])
 
         # Process the query string
-        if request.GET.has_key('fields'):
+        if 'fields' in request.GET:
             fields_to_return = request.GET['fields'].split(',')
         else:
             # Available fields (not returned by default):
-- 
GitLab