def clean_friend_emails(self): multipl_hacks = self.cleaned_data.get('friend_emails', '') if multipl_hacks: try: check_friend_emails(multipl_hacks, self.instance.hacker.email) except Exception as e: raise forms.ValidationError(str(e)) return multipl_hacks
def clean_friend_emails(self): multipl_hacks = self.cleaned_data.get('friend_emails', '') if multipl_hacks: try: check_friend_emails(multipl_hacks, self.instance.hacker.email) except Exception as e: raise forms.ValidationError(e.message) return multipl_hacks