@staticmethod
PYL-R0201114 return response
115
116 # TODO Rename this here and in `post`
117 def refresh_op(self, response, cookie_name):118 cookie_secure = getattr(settings, "JWT_AUTH_SECURE", False)
119 cookie_httponly = getattr(settings, "JWT_AUTH_HTTPONLY", True)
120 cookie_samesite = getattr(settings, "JWT_AUTH_SAMESITE", "Lax")
224 model = Profile
225 exclude = ["user", "uid"]
226
227 def get_avatar(self, obj):228 profile = Profile.objects.get(user=obj.user)
229 return profile.get_avatar_url()
230
209 model = Profile
210 exclude = ["user", "uid"]
211
212 def get_avatar(self, obj):213 profile = Profile.objects.get(user=obj.user)
214 return profile.get_avatar_url()
215
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.