| Conditions | 6 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # from wye.base.constants import WorkshopStatus |
||
| 4 | # # def validate_action_param(action_map): |
||
| 5 | # # print("validate_action_param") |
||
| 6 | # # def wrapper(func): |
||
| 7 | # # def inner(self, user, **kwargs): |
||
| 8 | # # response = {'status': False, 'msg': ''} |
||
| 9 | # # pk = kwargs.get('pk') |
||
| 10 | # # action = kwargs.get('action') |
||
| 11 | |||
| 12 | # # # validate parameters |
||
| 13 | # # if not (pk and action): |
||
| 14 | # # response['msg'] = 'Invalid request.' |
||
| 15 | # # return response |
||
| 16 | # # # validate action |
||
| 17 | # # if action not in action_map: |
||
| 18 | # # response['msg'] = 'Action not allowed.' |
||
| 19 | # # return response |
||
| 20 | # # return func(self, user, **kwargs) |
||
| 21 | # # return inner |
||
| 22 | # # return wrapper |
||
| 43 |