- 우분투에서 로컬 호스트 실행할 때 venv 돌려야함;;
source relieftalk-pretest/bin/activate
- 기능개선
- 오전 8시 ~ 다음날 오전 8시 사이에 릴리프톡을 제출한 고객은 하루~이틀 안에 답신을 받는다. 23일 8시부터 24일 8시 사이에 제출하면 24일 23:59 전에 답신을 받아야하는 것. 이것보다 늦게 회신을 하게 되면 '기한초과' 태그가 붙게 되는데 datetime 객체를 활용하여 다음과 같이 구현했다:
def voiceletter_status_converter(process_status, matchtime):
now = datetime.now()
due = matchtime.replace(hour=11, minute=59, second=59) if matchtime.hour <= 8 else now.replace(hour=11, minute=59, second=59) + timedelta(days=1)
if process_status < 2:
return '제출대기'
elif process_status < 3 and now - due > timedelta(0):
return '답신필요(기한초과)'
elif process_status < 3:
return '답신필요'
elif process_status <=5 and now - due > timedelta(0):
return '답신완료(기한초과)'
elif process_status <= 5:
return '답신완료'
else:
return False