|
|
|
@ -29,6 +29,12 @@ def update_positions(): |
|
|
|
|
required = cfg.get('positions_required') |
|
|
|
|
available = cfg.get('positions_available') |
|
|
|
|
|
|
|
|
|
# remove falsy values |
|
|
|
|
body = { |
|
|
|
|
positions: username for positions, username in body.items() |
|
|
|
|
if username |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for position in body.keys(): |
|
|
|
|
if position not in available: |
|
|
|
|
return { |
|
|
|
@ -36,7 +42,7 @@ def update_positions(): |
|
|
|
|
}, 400 |
|
|
|
|
|
|
|
|
|
for position in required: |
|
|
|
|
if not body.get(position): |
|
|
|
|
if position not in body: |
|
|
|
|
return { |
|
|
|
|
'error': f'missing required position: {position}' |
|
|
|
|
}, 400 |
|
|
|
|