parent
d0c42aaad1
commit
a400df1668
|
|
@ -1,88 +1,143 @@
|
|||
from django.conf import settings
|
||||
|
||||
TEACHER_KEY = 'teacher'
|
||||
STUDENT_KEY = 'student'
|
||||
MYSKILLBOX_PLATFORM = 'myskillbox'
|
||||
MYKV_PLATFORM = 'my-kv'
|
||||
DHA_PLATFORM = 'my-dha'
|
||||
DHF_PLATFORM = 'my-dhf'
|
||||
TEACHER_KEY = "teacher"
|
||||
STUDENT_KEY = "student"
|
||||
MYSKILLBOX_PLATFORM = "myskillbox"
|
||||
MYKV_PLATFORM = "my-kv"
|
||||
MYDHA_PLATFORM = "my-dha"
|
||||
MYDHF_PLATFORM = "my-dhf"
|
||||
|
||||
MYSKILLBOX_LICENSES = {
|
||||
"978-3-0355-1397-4": {
|
||||
'edition': STUDENT_KEY,
|
||||
'duration': 4 * 365,
|
||||
'name': 'Student 4 years',
|
||||
'platform': MYSKILLBOX_PLATFORM,
|
||||
'default': True
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 4 * 365,
|
||||
"name": "Student 4 years",
|
||||
"platform": MYSKILLBOX_PLATFORM,
|
||||
"default": True,
|
||||
},
|
||||
"978-3-0355-1860-3": {
|
||||
'edition': STUDENT_KEY,
|
||||
'duration': 365,
|
||||
'name': 'Student 1 year',
|
||||
'platform': MYSKILLBOX_PLATFORM
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 365,
|
||||
"name": "Student 1 year",
|
||||
"platform": MYSKILLBOX_PLATFORM,
|
||||
},
|
||||
"978-3-0355-1862-7": {
|
||||
'edition': STUDENT_KEY,
|
||||
'duration': 30,
|
||||
'name': 'Student test 1 month',
|
||||
'platform': MYSKILLBOX_PLATFORM
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 30,
|
||||
"name": "Student test 1 month",
|
||||
"platform": MYSKILLBOX_PLATFORM,
|
||||
},
|
||||
"978-3-0355-1861-0": {
|
||||
'edition': TEACHER_KEY,
|
||||
'duration': 30,
|
||||
'name': 'Teacher test 1 month',
|
||||
'platform': MYSKILLBOX_PLATFORM
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 30,
|
||||
"name": "Teacher test 1 month",
|
||||
"platform": MYSKILLBOX_PLATFORM,
|
||||
},
|
||||
"978-3-0355-1823-8": {
|
||||
'edition': TEACHER_KEY,
|
||||
'duration': 365,
|
||||
'name': 'Teacher 1 year',
|
||||
'platform': MYSKILLBOX_PLATFORM
|
||||
},
|
||||
'978-3-0355-2189-4': {
|
||||
'edition': STUDENT_KEY,
|
||||
'duration': 400,
|
||||
'name': 'Student test 1 month',
|
||||
'platform': MYKV_PLATFORM,
|
||||
'default': True
|
||||
},
|
||||
'978-3-0355-2188-7': {
|
||||
'edition': TEACHER_KEY,
|
||||
'duration': 400,
|
||||
'name': 'Student test 1 month',
|
||||
'platform': MYKV_PLATFORM
|
||||
},
|
||||
'978-3-0355-2276-1': {
|
||||
'edition': TEACHER_KEY,
|
||||
'duration': 260,
|
||||
'name': 'myDetailhandel DHA - Lehrpersonen (Lizenz)',
|
||||
'platform': DHA_PLATFORM
|
||||
},
|
||||
'978-3-0355-2275-4': {
|
||||
'edition': STUDENT_KEY,
|
||||
'duration': 260,
|
||||
'name': 'myDetailhandel DHA - Lernende (Lizenz)',
|
||||
'platform': DHA_PLATFORM
|
||||
},
|
||||
'978-3-0355-2274-7': {
|
||||
'edition': TEACHER_KEY,
|
||||
'duration': 260,
|
||||
'name': 'myDetailhandel DHF - Lehrpersonen (Lizenz)',
|
||||
'platform': DHF_PLATFORM
|
||||
},
|
||||
'978-3-0355-2273-0': {
|
||||
'edition': STUDENT_KEY,
|
||||
'duration': 260,
|
||||
'name': 'myDetailhandel DHF - Lernende (Lizenz)',
|
||||
'platform': DHF_PLATFORM
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 365,
|
||||
"name": "Teacher 1 year",
|
||||
"platform": MYSKILLBOX_PLATFORM,
|
||||
},
|
||||
}
|
||||
|
||||
MYKV_LICENSES = {
|
||||
"978-3-0355-2359-1": {
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 4 * 365,
|
||||
"name": "myKV Lizenz für Lernende, gültig 4 Jahre",
|
||||
"platform": MYKV_PLATFORM,
|
||||
"default": True,
|
||||
},
|
||||
"978-3-0355-2360-7": {
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 2 * 365,
|
||||
"name": "myKV Lizenz für Lernende, gültig 4 Jahre",
|
||||
"platform": MYKV_PLATFORM,
|
||||
},
|
||||
"978-3-0355-2361-4": {
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 1 * 365,
|
||||
"name": "myKV-Lizenzen für Lehrpersonen, gültig für 1 Jahr",
|
||||
"platform": MYKV_PLATFORM,
|
||||
},
|
||||
"978-3-0355-2189-4": {
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 400,
|
||||
"name": "Student test 1 month",
|
||||
"platform": MYKV_PLATFORM,
|
||||
},
|
||||
"978-3-0355-2188-7": {
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 400,
|
||||
"name": "Student test 1 month",
|
||||
"platform": MYKV_PLATFORM,
|
||||
},
|
||||
}
|
||||
|
||||
MYDHA_LICENSES = {
|
||||
"978-3-0355-2371-3": {
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 4 * 365,
|
||||
"name": "myDHA Lizenz für Lernende, gültig 4 Jahre",
|
||||
"platform": MYDHA_PLATFORM,
|
||||
"default": True,
|
||||
},
|
||||
"978-3-0355-2372-0": {
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 1 * 365,
|
||||
"name": "myDHA Lizenzen für Lehrpersonen, gültig für 1 Jahr",
|
||||
"platform": MYDHA_PLATFORM,
|
||||
},
|
||||
"978-3-0355-2276-1": {
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 260,
|
||||
"name": "myDetailhandel DHA - Lehrpersonen (Lizenz)",
|
||||
"platform": MYDHA_PLATFORM,
|
||||
},
|
||||
"978-3-0355-2275-4": {
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 260,
|
||||
"name": "myDetailhandel DHA - Lernende (Lizenz)",
|
||||
"platform": MYDHA_PLATFORM,
|
||||
},
|
||||
}
|
||||
|
||||
MYDHF_LICENSES = {
|
||||
"978-3-0355-2369-0": {
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 4 * 365,
|
||||
"name": "myDHF Lizenz für Lernende, gültig 4 Jahre",
|
||||
"platform": MYDHF_PLATFORM,
|
||||
"default": True,
|
||||
},
|
||||
"978-3-0355-2370-6": {
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 1 * 365,
|
||||
"name": "myDHF Lizenzen für Lehrpersonen, gültig für 1 Jahr",
|
||||
"platform": MYDHF_PLATFORM,
|
||||
},
|
||||
"978-3-0355-2274-7": {
|
||||
"edition": TEACHER_KEY,
|
||||
"duration": 260,
|
||||
"name": "myDetailhandel DHF - Lehrpersonen (Lizenz)",
|
||||
"platform": MYDHF_PLATFORM,
|
||||
},
|
||||
"978-3-0355-2273-0": {
|
||||
"edition": STUDENT_KEY,
|
||||
"duration": 260,
|
||||
"name": "myDetailhandel DHF - Lernende (Lizenz)",
|
||||
"platform": MYDHF_PLATFORM,
|
||||
},
|
||||
}
|
||||
|
||||
LICENSES = dict(
|
||||
**MYSKILLBOX_LICENSES, **MYKV_LICENSES, **MYDHA_LICENSES, **MYDHF_LICENSES
|
||||
)
|
||||
|
||||
|
||||
def get_license_dict():
|
||||
return {
|
||||
k: v for k, v in MYSKILLBOX_LICENSES.items() if v.get('platform') == settings.PLATFORM
|
||||
}
|
||||
return {k: v for k, v in LICENSES.items() if v.get("platform") == settings.PLATFORM}
|
||||
|
||||
|
||||
def get_valid_isbns():
|
||||
|
|
@ -94,8 +149,6 @@ def is_myskillbox_product(isbn):
|
|||
|
||||
|
||||
def get_default_isbn():
|
||||
defaults = {
|
||||
k: v for k, v in get_license_dict().items() if v.get('default', False)
|
||||
}
|
||||
defaults = {k: v for k, v in get_license_dict().items() if v.get("default", False)}
|
||||
default_isbns = list(defaults.keys())
|
||||
return default_isbns[0]
|
||||
|
|
|
|||
Loading…
Reference in New Issue