def clean_language(self):
        data = self.cleaned_data['language']
        if isinstance(data, Language):
            pk = data.pk
        else:
            pk = int(data)
        if pk in self.disabled_langs:
            raise forms.ValidationError(_(u'Enter a valid value.'))
        return data
Switches and Samples shouldn't require a request context.
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/teams/forms.py/TeamSimpleForm.clean_language--crossover with--dataset/ETHPy150Open jsocol/django-waffle/waffle/tests/test_templates.py/WaffleTemplateTests.test_no_request_context