Browse Source

pyi2phosts/postkey/views.py: add i18n

pull/1/head
Hidden Z 13 years ago
parent
commit
65759c762f
  1. 3
      pyi2phosts/postkey/views.py

3
pyi2phosts/postkey/views.py

@ -8,6 +8,7 @@ from django import forms
from django.shortcuts import render_to_response from django.shortcuts import render_to_response
from django.shortcuts import redirect from django.shortcuts import redirect
from django.template import RequestContext from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
import settings import settings
from pyi2phosts.postkey.models import i2phost from pyi2phosts.postkey.models import i2phost
@ -35,7 +36,7 @@ class AddForm(forms.ModelForm):
data = validate_hostname(data) data = validate_hostname(data)
# Another set of reserved hostnames (suggested by zzz) # Another set of reserved hostnames (suggested by zzz)
if re.search(r'(^|\.)(i2p|i2p2|geti2p|mail|project|i2project|i2pproject|i2p-project).i2p$', data): 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 return data
def clean_b64hash(self): def clean_b64hash(self):
"""Validate base64 hash""" """Validate base64 hash"""

Loading…
Cancel
Save