parameters: (request:HttpRequest)
return_statement: return JsonResponse({'success': 'Updated user profile'})
docstring: Allows users to update some of their user settings.
  
      If the request is done by the anonymous user, nothing is updated, but
      no error is raised.
docstring_summary: Allows users to update some of their user settings.
docstring_tokens: Allows users to update some of their user settings .
function: def update_user_profile(request:HttpRequest) -> JsonResponse:
      """ Allows users to update some of their user settings.
  
      If the request is done by the anonymous user, nothing is updated, but
      no error is raised.
      """
      # Ignore anonymous user
      if request.user == get_anonymous_user() or not request.user.is_authenticated:
          return JsonResponse({'success': "The user profile of the " +
                  "anonymous user won't be updated"})
  
      # Save user profile
      request.user.userprofile.save()
  
      return JsonResponse({'success': 'Updated user profile'})
function_tokens: def update_user_profile ( request : HttpRequest ) -> JsonResponse : # Ignore anonymous user if request . user == get_anonymous_user ( ) or not request . user . is_authenticated : return JsonResponse ( { 'success' : "The user profile of the " + "anonymous user won't be updated" } ) # Save user profile request . user . userprofile . save ( ) return JsonResponse ( { 'success' : 'Updated user profile' } )