Fixed exception on user-not-found in form

This commit is contained in:
Sebastian Lohff 2011-10-30 03:16:14 +01:00
parent f7dc5bda50
commit f97a501f1c
2 changed files with 3 additions and 1 deletions

View File

@ -35,5 +35,5 @@ class VirtualTransactionForm(forms.ModelForm):
try: try:
user = User.objects.get(username=self.cleaned_data['recipient']) user = User.objects.get(username=self.cleaned_data['recipient'])
except User.DoesNotExist: except User.DoesNotExist:
raise ValidationError(u"Emfpänger '%s' konnte nicht gefunden werden" % self.cleaned_data['user']) raise ValidationError(u"Emfpänger '%s' konnte nicht gefunden werden" % self.cleaned_data['recipient'])
return user return user

View File

@ -20,6 +20,8 @@ urlpatterns = patterns('',
(r'^transaction/', include('transaction.urls')), (r'^transaction/', include('transaction.urls')),
(r'^store/', include('buyable.urls')), (r'^store/', include('buyable.urls')),
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'media'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'media'}),
(r'^docs/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'docs'}),
# Uncomment the next line to enable the admin: # Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)), (r'^admin/', include(admin.site.urls)),