mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-02 01:44:40 +00:00
pyi2phosts/postkey/views.py: add i18n
This commit is contained in:
parent
f81e9664f3
commit
65759c762f
@ -8,6 +8,7 @@ from django import forms
|
||||
from django.shortcuts import render_to_response
|
||||
from django.shortcuts import redirect
|
||||
from django.template import RequestContext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
import settings
|
||||
from pyi2phosts.postkey.models import i2phost
|
||||
@ -35,7 +36,7 @@ class AddForm(forms.ModelForm):
|
||||
data = validate_hostname(data)
|
||||
# Another set of reserved hostnames (suggested by zzz)
|
||||
if re.search(r'(^|\.)(i2p|i2p2|geti2p|mail|project|i2project|i2pproject|i2p-project).i2p$', data):
|
||||
raise forms.ValidationError('Trying to use hostname from additional reserved set')
|
||||
raise forms.ValidationError(_('Trying to use hostname from additional reserved set'))
|
||||
return data
|
||||
def clean_b64hash(self):
|
||||
"""Validate base64 hash"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user