Update valid product states, update subscription duration

This commit is contained in:
Christian Cueni 2021-06-29 11:13:05 +02:00
parent b55e9a26d3
commit b902ca1e92
2 changed files with 6 additions and 3 deletions

View File

@ -12,6 +12,9 @@ from core.logger import get_logger
logger = get_logger(__name__)
VALID_PRODUCT_STATES = ['waiting', 'paid', 'completed', 'shipped']
class HepClientException(Exception):
pass
@ -157,7 +160,7 @@ class HepClient:
def filter_valid_products(product):
if product['status'] not in ['paid', 'new']:
if product['status'] not in VALID_PRODUCT_STATES:
return False
expiry_delta = product['activated'] + timedelta(product['license']['duration'])

View File

@ -9,7 +9,7 @@ MYSKILLBOX_LICENSES = {
},
"978-3-0355-1860-3": {
'edition': STUDENT_KEY,
'duration': 365,
'duration': 455,
'name': 'Student 1 year'
},
"978-3-0355-1862-7": {
@ -24,7 +24,7 @@ MYSKILLBOX_LICENSES = {
},
"978-3-0355-1823-8": {
'edition': TEACHER_KEY,
'duration': 365,
'duration': 455,
'name': 'Teacher 1 year'
}
}