From: Aleksander Ɓukasz Date: Tue, 12 Nov 2013 08:59:27 +0000 (+0100) Subject: Fix in admin view X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/a03fd84930ff74ec7280e380d9c5cf703dfa60ba?ds=inline Fix in admin view --- 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: