Esempio n. 1
0
def savePasswordPage(request):
    try:
        config = getConfig()
        log = config['log']
        configureLogging(log)

        cookieVal= ''
        try:
            cookieVal=validateCookieService(request)    
        except Exception as e:
            raise
        
       
        if request.method == 'GET':   
            customerDetailsObj=getCustomerDetailsService(cookieVal)
            
            menuItemList=getMenuItemsByCustomerStatuService(customerDetailsObj.custstatus) 
            currentPath=getCurrentPath(request.path)
            menuItemObjList = [child for menuItemObj in menuItemList for child in menuItemObj['child'] if child['menuItemLink'] == currentPath ]
            if len(menuItemObjList) == 1:
                return render(request,"home.html",{"template_name":"password.html","menuItemList":menuItemList})  
            else:
                raise Exception("Access Denied")    
        
        
    except Exception as e:
        logging.error(str(e))
        if str(e) == "Authentication failure":
            return redirect('/ui/login')
        elif str(e) == "Access Denied":
            return redirect('../home/default')
        else:
            errorMessage = "Internal Server Error"
            redirectLink = False               
        return render(request,"error.html",{'redirectLink':redirectLink,'errorMessage':errorMessage})
Esempio n. 2
0
def dashboardPage(request):
    try:
        config = getConfig()
        log = config['log']
        configureLogging(log)
        
        cookieVal= ''
        try:
            cookieVal=validateCookieService(request)    
        except Exception as e:
            raise 
        
        if request.method == 'GET':   
            customerDetailsObj=getCustomerDetailsService(cookieVal)
            custTaskObjs=getCustTasksByCustIdService(customerDetailsObj.id)
            profileLink = ''
            profileCompleted = False
            
            for custTask in custTaskObjs:
  
                if custTask.taskname =="Personal" and custTask.status == 'P':
                    profileLink = 'personal-profile'
                    profileCompleted = False
                    break
                elif custTask.taskname == "Investment" and custTask.status == 'P':
                    profileLink =  'investment-profile'
                    profileCompleted = False
                    break
                elif custTask.taskname == "Document" and custTask.status == 'P':
                    profileLink = 'documents'
                    profileCompleted = False
                    break
                        
            if profileLink == '':
                profileCompleted = True    
            
            menuItemList=getMenuItemsByCustomerStatuService(customerDetailsObj.custstatus) 
            
            currentPath=getCurrentPath(request.path)
            menuItemObjList = [child for menuItemObj in menuItemList for child in menuItemObj['child'] if child['menuItemLink'] == currentPath ]
            if len(menuItemObjList) == 1:
                return render(request,"home.html",{"template_name":"dashboardview1.html",'menuItemList':menuItemList,'profileLink':profileLink,'profileCompleted':profileCompleted})  
            else:
                raise Exception("Access Denied")    
        
    except Exception as e:
        logging.error(str(e))
        if str(e) == "Authentication failure":
            return redirect('/ui/login')
        elif str(e) == "Access Denied":
            return redirect('../home/default')
        else:
            errorMessage = "Internal Server Error"
            redirectLink = False
        return render(request,"error.html",{'redirectLink':redirectLink,'errorMessage':errorMessage})
Esempio n. 3
0
def homePage(request):
    try:
        config = getConfig()
        log = config['log']
        configureLogging(log)
        
        cookieVal= ''
        try:
            cookieVal=validateCookieService(request)    
        except Exception as e:
            raise 
        
        if request.method == 'GET':  
            
            
            
            customerDetailsObj=getCustomerDetailsService(cookieVal)
            
            if customerDetailsObj.custstatus in "S,I" and not checkSubscriptionExpirationService(cookieVal):
                updateCustomerDetailsService({'custregmobile':cookieVal,'customerStatus':'E'})
                return redirect('../home/default')
            
            
            
            if customerDetailsObj.custstatus == 'P':
                return redirect('../home/save-password')    
            elif customerDetailsObj.custstatus == 'R':
                return redirect('../home/subscription')    
            elif customerDetailsObj.custstatus == 'S':
                return redirect('../home/dashboard')    
            elif customerDetailsObj.custstatus == 'I':
                return redirect('../home/invested')    
            elif customerDetailsObj.custstatus == 'E':
                return redirect('../home/subscription')    
            
            #return render(request,"home.html",{"template_name":"personalProfile.html"})  
            #return render(request,"home.html",{"template_name":"dashboardview1.html"})  
           
        
    except Exception as e:
        logging.error(str(e))
        if str(e) == "Authentication failure":
            return redirect('/ui/login')
        else:
            errorMessage = "Internal Server Error"
            redirectLink = False               
            return render(request,"error.html",{'redirectLink':redirectLink,'errorMessage':errorMessage})