parent
9ad3e9e972
commit
182208a6f8
@ -34,6 +34,7 @@ from django.utils.safestring import mark_safe
|
||||
from django.utils.timezone import localtime
|
||||
from django.utils.formats import localize
|
||||
from .templatetags.event_extra import event_field_verbose_name, field_to_html
|
||||
import os
|
||||
|
||||
import logging
|
||||
|
||||
@ -214,7 +215,8 @@ class EventForm(ModelForm):
|
||||
self.cleaned_data['old_local_image'] != "":
|
||||
basename = self.cleaned_data['old_local_image']
|
||||
old = settings.MEDIA_ROOT + "/" + basename
|
||||
self.cleaned_data['local_image'] = File(name=basename, file=open(old, "rb"))
|
||||
if os.path.isfile(old):
|
||||
self.cleaned_data['local_image'] = File(name=basename, file=open(old, "rb"))
|
||||
|
||||
|
||||
class MultipleChoiceFieldAcceptAll(MultipleChoiceField):
|
||||
|
Loading…
x
Reference in New Issue
Block a user