@login_required
def hosting(request):
 if (not appsettings.OFFER_HOSTING):
  return redirect(u'home')
 if (request.method == u'POST'):
  form = HostingForm(request.POST)
  if form.is_valid():
   context = form.cleaned_data
   context[u'username'] = request.user.username
   mail_admins_contact(request, u'Hosting request for %(project)s', HOSTING_TEMPLATE, context, form.cleaned_data[u'email'])
   return redirect(u'home')
 else:
  initial = get_initial_contact(request)
  form = HostingForm(initial=initial)
 return render(request, u'accounts/hosting.html', {u'form': form, u'title': _(u'Hosting')})

@ login_required def hosting ( request ) : if ( not appsettings . OFFER_HOSTING ) : return redirect ( u'home' ) if ( request . method == u'POST' ) : form = HostingForm ( request . POST ) if form . is_valid ( ) : context = form . cleaned_data context [ u'username' ] = request . user . username mail_admins_contact ( request , u'Hosting request for %(project)s' , HOSTING_TEMPLATE , context , form . cleaned_data [ u'email' ] ) return redirect ( u'home' ) else : initial = get_initial_contact ( request ) form = HostingForm ( initial = initial ) return render ( request , u'accounts/hosting.html' , { u'form' : form , u'title' : _ ( u'Hosting' ) } )
form for hosting request .