From a03fd84930ff74ec7280e380d9c5cf703dfa60ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 12 Nov 2013 09:59:27 +0100 Subject: [PATCH] Fix in admin view --- wtem/admin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wtem/admin.py b/wtem/admin.py index 47e0a77..ed72a83 100644 --- a/wtem/admin.py +++ b/wtem/admin.py @@ -24,7 +24,11 @@ readonly_fields = ('submitted_by', 'first_name', 'last_name', 'email', 'key', 'k class AttachmentWidget(forms.Widget): def render(self, name, value, *args, **kwargs): - return mark_safe('%s' % (name, value, value, value)) + if value: + a_tag = '%s' % (value, value) + else: + a_tag = 'brak' + return mark_safe(('' + a_tag) % (name, value)) class SubmissionFormBase(forms.ModelForm): class Meta: -- 2.20.1