2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 13:57:45 +00:00

get rid of photo

This commit is contained in:
expo
2009-08-29 18:08:55 +01:00
parent 9f169fb2b9
commit 29adaa03c6
4 changed files with 15 additions and 11 deletions

View File

@@ -11,14 +11,14 @@ def saveMugShot(mugShotPath, mugShotFilename, person):
else:
mugShotFilename=mugShotFilename # just in case one doesn't
dummyObj=models.Photo(file=mugShotFilename)
dummyObj=models.DPhoto(file=mugShotFilename)
#Put a copy of the file in the right place. mugShotObj.file.path is determined by the django filesystemstorage specified in models.py
if not os.path.exists(dummyObj.file.path):
shutil.copy(mugShotPath, dummyObj.file.path)
mugShotObj, created = save_carefully(
models.Photo,
models.DPhoto,
lookupAttribs={'is_mugshot':True, 'file':mugShotFilename},
nonLookupAttribs={'caption':"Mugshot for "+person.first_name+" "+person.last_name}
)