def send_email(*args, **kwargs): user = kwargs['user'].as_dict() if (user['role_id'] != ROLE['admin']): return Response(json.dumps({'message': 'unauthorized'}), status=401, mimetype='application/json') else: return AdminController.send_email(request, user)
def send_email(*args, **kwargs): user = kwargs['user'].as_dict() if (user['role_id'] != ROLE['admin']): return 'unauthorized' else: return AdminController.send_email(request, user)