parameters: (self, request)
docstring: ensures request is authorized:
              - secret matches an organization's shared_secret
              - the organization has registration_enabled set to True
docstring_summary: ensures request is authorized:
              - secret matches an organization's shared_secret
              - the organization has registration_enabled set to True
docstring_tokens: ensures request is authorized : - secret matches an organization s shared_secret - the organization has registration_enabled set to True
function: def forbidden(self, request):
          """
          ensures request is authorized:
              - secret matches an organization's shared_secret
              - the organization has registration_enabled set to True
          """
          try:
              secret = request.POST.get('secret')
              org_settings = self.org_config_settings_model.objects.select_related(
                  'organization'
              ).get(shared_secret=secret, organization__is_active=True)
          except self.org_config_settings_model.DoesNotExist:
              return invalid_response(request, 'error: unrecognized secret', status=403)
          if not org_settings.registration_enabled:
              return invalid_response(request, 'error: registration disabled', status=403)
          # set an organization attribute as a side effect
          # this attribute will be used in ``init_object``
          self.organization = org_settings.organization
function_tokens: def forbidden ( self , request ) : try : secret = request . POST . get ( 'secret' ) org_settings = self . org_config_settings_model . objects . select_related ( 'organization' ) . get ( shared_secret = secret , organization__is_active = True ) except self . org_config_settings_model . DoesNotExist : return invalid_response ( request , 'error: unrecognized secret' , status = 403 ) if not org_settings . registration_enabled : return invalid_response ( request , 'error: registration disabled' , status = 403 ) # set an organization attribute as a side effect # this attribute will be used in ``init_object`` self . organization = org_settings . organization