~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to wlscreens/models.py

  • Committer: franku
  • Date: 2019-04-09 06:34:51 UTC
  • mfrom: (530.1.5 mv_main_files)
  • Revision ID: somal@arcor.de-20190409063451-orglu7d2oda37ej9
moved files stored in folder widelands to folder widelands/mainpage

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
from django.core.files.uploadedfile import SimpleUploadedFile, UploadedFile
8
8
from django.core.files.storage import FileSystemStorage
9
9
import os
10
 
from settings import THUMBNAIL_SIZE, MEDIA_ROOT
 
10
from django.conf import settings
11
11
from django.urls import reverse
12
12
 
13
13
 
21
21
        # If the filename already exists, remove it as if it was a true file
22
22
        # system
23
23
        if self.exists(name):
24
 
            os.remove(os.path.join(MEDIA_ROOT, name))
 
24
            os.remove(os.path.join(settings.MEDIA_ROOT, name))
25
25
        return name
26
26
 
27
27
 
80
80
        if image.mode not in ('L', 'RGB'):
81
81
            image = image.convert('RGB')
82
82
 
83
 
        image.thumbnail(THUMBNAIL_SIZE, Image.ANTIALIAS)
 
83
        image.thumbnail(settings.THUMBNAIL_SIZE, Image.ANTIALIAS)
84
84
 
85
85
        # Save the thumbnail
86
86
        temp_handle = StringIO()