Check if email exists on Stormpath.

        The email address is unique across all Stormpath applications.
        The username is only unique within a Stormpath application.

def clean_email(self):
        """Check if email exists on Stormpath.

        The email address is unique across all Stormpath applications.
        The username is only unique within a Stormpath application.
        """
        try:
            accounts = APPLICATION.accounts.search({'email': self.cleaned_data['email']})
            if len(accounts):
                msg = 'User with that email already exists.'
                raise forms.ValidationError(msg)
        except Error as e:
            raise forms.ValidationError(str(e))

        return self.cleaned_data['email']