@login_required
def create_vacancy(request):
if request.method == 'POST':
vacancy_form = VacancyForm(data=request.POST)
if vacancy_form.is_valid():
user = request.user
vacancy = vacancy_form.save()
vacancy.save()
return HttpResponseRedirect('/accounts/profile/vacancy/all/')
else:
user = request.user
vacancy_form = VacancyForm()
return render(request, 'create_vacancy.html', {'vacancy_form': vacancy_form})
QGxvZ2luX3JlcXVpcmVkCmRlZiBjcmVhdGVfdmFjYW5jeShyZXF1ZXN0KToKICAgIGlmIHJlcXVlc3QubWV0aG9kID09ICdQT1NUJzoKICAgICAgICB2YWNhbmN5X2Zvcm0gPSBWYWNhbmN5Rm9ybShkYXRhPXJlcXVlc3QuUE9TVCkKICAgICAgICBpZiB2YWNhbmN5X2Zvcm0uaXNfdmFsaWQoKToKICAgICAgICAgICAgdXNlciA9IHJlcXVlc3QudXNlcgogICAgICAgICAgICB2YWNhbmN5ID0gdmFjYW5jeV9mb3JtLnNhdmUoKQogICAgICAgICAgICB2YWNhbmN5LnNhdmUoKQogICAgICAgICAgICByZXR1cm4gSHR0cFJlc3BvbnNlUmVkaXJlY3QoJy9hY2NvdW50cy9wcm9maWxlL3ZhY2FuY3kvYWxsLycpCiAgICBlbHNlOgogICAgICAgIHVzZXIgPSByZXF1ZXN0LnVzZXIKICAgICAgICB2YWNhbmN5X2Zvcm0gPSBWYWNhbmN5Rm9ybSgpCiAgICByZXR1cm4gcmVuZGVyKHJlcXVlc3QsICdjcmVhdGVfdmFjYW5jeS5odG1sJywgeyd2YWNhbmN5X2Zvcm0nOiB2YWNhbmN5X2Zvcm19KQ==