fork download
  1. @login_required
  2. def add_remove_bookmark(request, qid):
  3. uid = request.session.get('user')
  4. try:
  5. bookmark = Bookmark.objects.get(user=uid, profile=qid)
  6. bookmark.delete()
  7. except Bookmark.DoesNotExist:
  8. bookmark = Bookmark.objects.create(
  9. user=uid,
  10. profile=OdeskProfileData.objects.get(id=qid))
  11. bookmark.save()
  12. return HttpResponseRedirect('/bookmarks/' + qid)
Runtime error #stdin #stdout #stderr 0.02s 8736KB
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