我想在这个 ValidationError 中添加一个锚标记:
Customer.objects.get(email=value)
if self.register:
# this address is already registered
raise forms.ValidationError(
_('An account already exists for this email address')
)
锚标记将是<a href="some/url/to/login">Log in instead</a>
因此,当用户输入已经存在的电子邮件时,错误消息将类似于:
'此电子邮件地址的帐户已存在。而是<a>
登录</a>
?
提前致谢!