Commit 97bd3fb0 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler
Browse files

Fix deprecation warnings we get from Python/Django Rest Framework


Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 170c2384
......@@ -69,8 +69,8 @@ class RelatedOrderingFilter(filters.OrderingFilter):
field = model._meta.get_field(components[0])
# foreign key
if field.rel and len(components) == 2:
return self.is_valid_field(field.rel.to, components[1])
if field.remote_field and len(components) == 2:
return self.is_valid_field(field.remote_field.model, components[1])
return True
except FieldDoesNotExist:
return False
......
......@@ -85,7 +85,7 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher,
header = header[len('Basic '):].strip()
try:
decoded = base64.decodestring(header.encode())
decoded = base64.decodebytes(header.encode())
username, password = decoded.decode().split(':', 1)
except Exception:
raise Exception('Invalid authentication credentials')
......
Markdown is supported
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