@login_required<EOL>def add_event(request):
form = AddEventForm(request.POST or None)<EOL>if form.is_valid():<EOL><INDENT>instance = form.save(commit=False)<EOL>instance.sites = settings.SITE_ID<EOL>instance.submitted_by = request.user<EOL>instance.approved = True<EOL>instance.slug = slugify(instance.name)<EOL>instance.save()<EOL>messages.success(request, '<STR_LIT>')<EOL>return HttpResponseRedirect(reverse('<STR_LIT>'))<EOL><DEDENT>return render(request, '<STR_LIT>', {<EOL>'<STR_LIT>': form,<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>})<EOL>
Public form to add an event.