'Returns the parameters for Akismet\'s check-comment API endpoint.
The form cleaning also saves the data into the instance, which will
cause future calls to return different data. The results during the
initial form cleaning are cached in ._akismet_data, and returned for
future calls, such as the unit tests.'

def akismet_parameters(self):

    if (not getattr(self, '_akismet_data', None)):
        try:
            document = self.instance.document
        except ObjectDoesNotExist:
            self._akismet_data = AkismetNewDocumentData(self.request, self.cleaned_data, self.data.get('locale'))
        else:
            if document.current_revision:
                self._akismet_data = AkismetEditDocumentData(self.request, self.cleaned_data, document)
            else:
                based_on = self.cleaned_data.get('based_on')
                assert based_on, 'Expected    a    new    translation.'
                document = based_on.document
                self._akismet_data = AkismetNewTranslationData(self.request, self.cleaned_data, document, self.data.get('locale'))
    parameters = self._akismet_data.parameters.copy()
    parameters.update(self.akismet_parameter_overrides())
    return parameters
