From 5e9dfc6ea6ff59f7e23a7e83e0c8415dccc4ffce Mon Sep 17 00:00:00 2001 From: expoonserver Date: Tue, 7 Mar 2017 15:44:42 +0000 Subject: [PATCH] Fix Scan scanning, so that 2015#X01 format (with 'X') is accepted in scan directories. Allows 2016 data to be processed. --- core/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/models.py b/core/models.py index fa41f95..8527015 100644 --- a/core/models.py +++ b/core/models.py @@ -801,8 +801,8 @@ class DPhoto(TroggleImageModel): scansFileStorage = FileSystemStorage(location=settings.SURVEY_SCANS, base_url=settings.SURVEYS_URL) def get_scan_path(instance, filename): year=instance.survey.expedition.year - print "WN: ", type(instance.survey.wallet_number), instance.survey.wallet_number - number="%02d" % instance.survey.wallet_number + str(instance.survey.wallet_letter) #using %02d string formatting because convention was 2009#01 + #print "WN: ", type(instance.survey.wallet_number), instance.survey.wallet_number + number=str(instance.survey.wallet_number) + str(instance.survey.wallet_letter) #two strings formatting because convention is 2009#01 or 2009#X01 return os.path.join('./',year,year+r'#'+number,instance.contents+str(instance.number_in_wallet)+r'.jpg') class ScannedImage(TroggleImageModel):