fork download
  1. @login_required
  2. def resume(request, resume_id=1):
  3. form = ContactUserForm()
  4. user = request.user
  5. profile = user.profile
  6. if Resume.DoesNotExist:
  7. return create_resume(request)
  8. elif profile.profileType == "RC":
  9. sender = user.email
  10. resume = Resume.objects.get(id=resume_id)
  11. receiver = User.objects.get(id=resume.user_id)
  12. receiver_mail = receiver.email
  13. if request.POST:
  14. form = ContactUserForm(request.POST)
  15. if form.is_valid():
  16. cd = form.cleaned_data
  17. send_mail(
  18. cd['subject'],
  19. cd['message'],
  20. sender,
  21. [receiver_mail],
  22. )
  23. return render(request, 'resume.html',{'resume': Resume.objects.get(id=resume_id), 'form':form})
  24. else:
  25. form = ContactUserForm()
  26. return render(request, 'resume.html',{'resume': Resume.objects.get(id=resume_id), 'form':form})
  27. return render(request, 'candidate_resume.html',{'resume': Resume.objects.get(user=request.user), 'form':form})
Runtime error #stdin #stdout #stderr 0.02s 8688KB
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