diff --git a/apps/user/views.py b/apps/user/views.py index 257b8103..14ecef7b 100644 --- a/apps/user/views.py +++ b/apps/user/views.py @@ -2,6 +2,7 @@ import arrow from io import BytesIO from PIL import Image +from uuid import uuid4 from os.path import splitext from datetime import timedelta from paymentwall import Pingback @@ -224,6 +225,7 @@ class UserEditView(UpdateView): if ext == 'JPG': ext = 'JPEG' photo.save(buffer, ext) + fname = str(uuid4()) + '.' + ext.lower() self.object.photo.save(fname, buffer) buffer.close() if not request.POST._mutable: