Allow importing the old portal to be optional

This commit is contained in:
2020-01-23 06:54:34 +00:00
parent 6dcdeffa9e
commit c6182c8984
4 changed files with 15 additions and 7 deletions
+1 -2
View File
@@ -4,7 +4,6 @@ django.setup()
import datetime
from apiserver.api import models, old_models, utils
from apiserver.api.serializers import process_image
MEMBER_FIELDS = [
'id',
@@ -101,7 +100,7 @@ for o in old:
if str(o.id) in photo_folders:
folder = 'old_photos/' + str(o.id)
if 'photo.jpg' in os.listdir(folder):
small, medium, large = process_image(folder + '/photo.jpg')
small, medium, large = utils.process_image(folder + '/photo.jpg')
print('Found a photo')
models.Member.objects.create(photo_small=small, photo_medium=medium, photo_large=large, **new)