Fixed some missed instances of a setting name-change.

- Legacy-Id: 11266
This commit is contained in:
Henrik Levkowetz 2016-06-02 19:30:25 +00:00
parent c8ade2dff5
commit 1410168a5a
2 changed files with 4 additions and 4 deletions

View file

@ -24,10 +24,10 @@ def forward(apps,schema_editor):
for person in Person.objects.all():
dirty = False
if photo_name(person,thumb=False) in image_basenames:
person.photo = os.path.join(settings.PHOTO_URL_PREFIX, image_filenames[image_basenames.index(photo_name(person,thumb=False))])
person.photo = os.path.join(settings.PHOTOS_DIRNAME, image_filenames[image_basenames.index(photo_name(person,thumb=False))])
dirty = True
if photo_name(person,thumb=True) in image_basenames:
person.photo_thumb = os.path.join(settings.PHOTO_URL_PREFIX, image_filenames[image_basenames.index(photo_name(person,thumb=True))])
person.photo_thumb = os.path.join(settings.PHOTOS_DIRNAME, image_filenames[image_basenames.index(photo_name(person,thumb=True))])
dirty = True
if dirty:
person.save()

View file

@ -28,8 +28,8 @@ class PersonInfo(models.Model):
affiliation = models.CharField(max_length=255, blank=True, help_text="Employer, university, sponsor, etc.")
address = models.TextField(max_length=255, blank=True, help_text="Postal mailing address.")
biography = models.TextField(blank=True, help_text="Short biography for use on leadership pages.")
photo = models.ImageField(storage=NoLocationMigrationFileSystemStorage(location=settings.PHOTOS_DIR),upload_to=settings.PHOTO_URL_PREFIX,blank=True)
photo_thumb = models.ImageField(storage=NoLocationMigrationFileSystemStorage(location=settings.PHOTOS_DIR),upload_to=settings.PHOTO_URL_PREFIX,blank=True)
photo = models.ImageField(storage=NoLocationMigrationFileSystemStorage(location=settings.PHOTOS_DIR),upload_to=settings.PHOTOS_DIRNAME,blank=True)
photo_thumb = models.ImageField(storage=NoLocationMigrationFileSystemStorage(location=settings.PHOTOS_DIR),upload_to=settings.PHOTOS_DIRNAME,blank=True)
def __unicode__(self):
return self.plain_name()