fork download
  1. @login_required
  2. def vacancy_update(request, vacancy_id=1):
  3. obj = Vacancy.objects.get(id=vacancy_id)
  4. form = VacancyForm(request.POST, instance=obj)
  5. if request.method == 'POST':
  6. if form.is_valid():
  7. form.save(commit=False)
  8. return HttpResponseRedirect('/accounts/profile/vacancy/all/')
  9. else:
  10. user = request.user
  11. obj = Vacancy.objects.get(pk=vacancy_id)
  12. form = VacancyForm(instance=obj)
  13. args = {}
  14. args.update(csrf(request))
  15. args['form'] = form
  16. return render_to_response('vacancy_update.html', args)
Runtime error #stdin #stdout #stderr 0.02s 8696KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
NameError: name 'login_required' is not defined