@require_POST
@login_required
def archive_question(request, question_id):
 question = get_object_or_404(Question, pk=question_id)
 if (not question.allows_archive(request.user)):
  raise PermissionDenied
 question.is_archived = (not question.is_archived)
 log.info(('User %s set is_archived=%s on question with id=%s ' % (request.user, question.is_archived, question.id)))
 question.save()
 return HttpResponseRedirect(question.get_absolute_url())

@ require_POST @ login_required def archive_question ( request , question_id ) : question = get_object_or_404 ( Question , pk = question_id ) if ( not question . allows_archive ( request . user ) ) : raise PermissionDenied question . is_archived = ( not question . is_archived ) log . info ( ( 'User %s set is_archived=%s on question with id=%s ' % ( request . user , question . is_archived , question . id ) ) ) question . save ( ) return HttpResponseRedirect ( question . get_absolute_url ( ) )
archive or unarchive a question .