learningequality / kolibri-instant-schools-plugin

4 stars 10 forks source link

Handle cases where request.data has been passed as a raw string #199

Open sentry-io[bot] opened 1 year ago

sentry-io[bot] commented 1 year ago

AttributeError: 'str' object has no attribute 'get'

Sentry Issue: KOLIBRI-BACKEND-2E8

AttributeError: 'str' object has no attribute 'get'
(6 additional frame(s) were not displayed)
...
  File "rest_framework/views.py", line 455, in handle_exception
    self.raise_uncaught_exception(exc)
  File "rest_framework/views.py", line 492, in dispatch
    response = handler(request, *args, **kwargs)
  File "kolibri/core/auth/api.py", line 696, in create
    data = self.extract_request_data(request)
  File "kolibri_instant_schools_plugin/auth/api.py", line 48, in extract_request_data
    data = super(PhoneNumberSignUpViewSet, self).extract_request_data(request)
  File "kolibri/core/auth/api.py", line 686, in extract_request_data
    "username": request.data.get("username", ""),