Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get(self, request):
peril_codes = {PERILS[p]['id']: {'desc': PERILS[p]['desc']} for p in PERILS.keys()}
peril_groups = {
PERIL_GROUPS[g]['id']: {
'desc': PERIL_GROUPS[g]['desc'],
'peril_ids': PERIL_GROUPS[g]['peril_ids']
} for g in PERIL_GROUPS.keys()
}
return Response({
'oasislmf_version': oasislmf_package_ver,
'peril_codes': peril_codes,
'peril_groups': peril_groups
})