temporary hack to ignore svg files
This commit is contained in:
parent
8b8c30d1b7
commit
957c99e57d
@ -1328,15 +1328,16 @@ class Event(models.Model):
|
||||
pass
|
||||
|
||||
ext = basename.split(".")[-1]
|
||||
filename = "%s.%s" % (uuid.uuid4(), ext)
|
||||
if ext[:3].lower() != "svg": # temporary hack to ignore svg files
|
||||
filename = "%s.%s" % (uuid.uuid4(), ext)
|
||||
|
||||
try:
|
||||
tmpfile, _ = urllib.request.urlretrieve(self.image)
|
||||
except Exception:
|
||||
return None
|
||||
try:
|
||||
tmpfile, _ = urllib.request.urlretrieve(self.image)
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
# if the download is ok, then create the corresponding file object
|
||||
self.local_image = File(name=filename, file=open(tmpfile, "rb"))
|
||||
# if the download is ok, then create the corresponding file object
|
||||
self.local_image = File(name=filename, file=open(tmpfile, "rb"))
|
||||
|
||||
def add_pending_organisers(self, organisers):
|
||||
self.pending_organisers = organisers
|
||||
|
Loading…
x
Reference in New Issue
Block a user