def _api_send_reminder(request): if not get_param(request, 'vacancy_id'): return JsonHttpResponse({'error': 'missing argument'}) v = Vacancy.by_id(get_param(request, 'vacancy_id')) if not v: raise Http404 if not v.pool.may_manage(request.user): raise PermissionDenied send_reminder(v, update=False) return JsonHttpResponse({'success': True})
def _api_send_reminder(request): if not 'vacancy_id' in request.REQUEST: return JsonHttpResponse({'error': 'missing argument'}) v = Vacancy.by_id(request.REQUEST['vacancy_id']) if not v: raise Http404 if not v.pool.may_manage(request.user): raise PermissionDenied send_reminder(v, update=False) return JsonHttpResponse({'success': True})
def _api_send_reminder(request): if not 'vacancy_id' in request.REQUEST: return JsonHttpResponse({'error': 'missing argument'}) v = Vacancy.by_id(request.REQUEST['vacancy_id']) if not v: raise Http404 print v._data print v.pool_id print v.pool if not request.user.cached_groups_names & set(['secretariaat', v.pool.administrator]): raise PermissionDenied send_reminder(v, update=False) return JsonHttpResponse({'success': True})
def _api_send_reminder(request): if not 'vacancy_id' in request.REQUEST: return JsonHttpResponse({'error': 'missing argument'}) v = Vacancy.by_id(request.REQUEST['vacancy_id']) if not v: raise Http404 print v._data print v.pool_id print v.pool if not request.user.cached_groups_names & set( ['secretariaat', v.pool.administrator]): raise PermissionDenied send_reminder(v, update=False) return JsonHttpResponse({'success': True})
# vim: et:sta:bs=2:sw=4: import _import import locale from kn.planning.entities import Vacancy from kn.planning.utils import send_reminder locale.setlocale(locale.LC_ALL, 'nl_NL') vacancies = Vacancy.all_needing_reminder() for vacancy in vacancies: if vacancy.assignee is None: continue send_reminder(vacancy)
# vim: et:sta:bs=2:sw=4: import _import # noqa: F401 from kn.planning.entities import Vacancy from kn.planning.utils import send_reminder vacancies = Vacancy.all_needing_reminder() for vacancy in vacancies: if vacancy.assignee is None: continue send_reminder(vacancy)