Ejemplo n.º 1
0
def process_request(request):
    result = {}
    result['VK_APP_ID'] = settings.VK_APP_ID
    result['VK_COMPLETE_URL'] = 'http://bonus-house.ru/complete/vkontakte/'
    result['fb_app_id'] = settings.FACEBOOK_APP_ID
    if not request.user.is_authenticated() and request.method != 'POST':
        result['login_form'] = LoginForm()
        result['register_form'] = RegisterForm()
    if request.path == '/oferta/' or request.path.startswith('/accounts/password'):
        result['hide_login_overlay'] = True
    result['DOL_PROJECT_ID'] = settings.DOL_PROJECT_ID
    if request.method == 'POST' and request.POST.get('call_me'):
        call_me_form = CallMeForm(request.POST)
        call_me_form.is_valid()
        result['show_call_me_form'] = True
    else:
        call_me_form = CallMeForm()
    result['call_me_form'] = call_me_form
    result['cur_date'] = now()
    result['BASE_URL'] = settings.BASE_URL
    result['CURRENT_URL'] = request.path

    result['share_link_form'] = ShareLinkForm()
    return result
Ejemplo n.º 2
0
 def process_request(self, request):
     if request.method == 'POST' and request.POST.get('call_me'):
         call_me_form = CallMeForm(request.POST)
         if call_me_form.is_valid():
             call_me_form.save()
             return redirect('call_me_success')