Skip to content
Snippets Groups Projects
Unverified Commit 6c69096b authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Fix context deprecation in latest django

parent dce3fc84
No related branches found
Tags 1.4.4
No related merge requests found
Pipeline #43332 passed with warnings
......@@ -2,11 +2,10 @@ from rest_framework import compat
class CurrentUserProfileDefault(object):
def set_context(self, serializer_field):
self.user = serializer_field.context['request'].user
requires_context = True
def __call__(self):
return self.user.profile
def __call__(self, serializer_field):
return serializer_field.context['request'].user.profile
def __repr__(self):
return compat.unicode_to_repr('%s()' % self.__class__.__name__)
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