Fixed exception on user-not-found in form

master
Sebastian Lohff 13 years ago
parent f7dc5bda50
commit f97a501f1c

@ -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

@ -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)),

Loading…
Cancel
Save