def clean_key(self): client = self.cleaned_data['client'] key = self.cleaned_data['key'] calced_key = make_api_key(client) if key != calced_key: raise forms.ValidationError(u"invalid key") return key
def calc_api_key(seed): return make_api_key(seed)