parameters: (request, event_id)
docstring: Set event type. Should be an AJAX POST.
  
      :param request: Django request object (Required)
      :type request: :class:`django.http.HttpRequest`
      :param event_id: The ObjectId of the event to update.
      :type event_id: str
      :returns: :class:`django.http.HttpResponse`
docstring_summary: Set event type. Should be an AJAX POST.
docstring_tokens: Set event type . Should be an AJAX POST .
function: def set_event_type(request, event_id):
      """
      Set event type. Should be an AJAX POST.
  
      :param request: Django request object (Required)
      :type request: :class:`django.http.HttpRequest`
      :param event_id: The ObjectId of the event to update.
      :type event_id: str
      :returns: :class:`django.http.HttpResponse`
      """
  
      if request.method == 'POST':
          user = request.user
          if user.has_access_to(EventACL.TYPE_EDIT):
              event_type = request.POST.get('type', None)
              return HttpResponse(json.dumps(update_event_type(event_id,
                                                               event_type,
                                                               user.username)),
                                  content_type="application/json")
          else:
              return HttpResponse(json.dumps({'success':False,
                                              'message':'User does not have permission to edit event type.'}))
      else:
          error = "Expected POST"
          return render(request, "error.html", {"error": error})
function_tokens: def set_event_type ( request , event_id ) : if request . method == 'POST' : user = request . user if user . has_access_to ( EventACL . TYPE_EDIT ) : event_type = request . POST . get ( 'type' , None ) return HttpResponse ( json . dumps ( update_event_type ( event_id , event_type , user . username ) ) , content_type = "application/json" ) else : return HttpResponse ( json . dumps ( { 'success' : False , 'message' : 'User does not have permission to edit event type.' } ) ) else : error = "Expected POST" return render ( request , "error.html" , { "error" : error } )