def get(self, request): user_properties = user_pages(request.user) user_property_values = user_properties.getUserViews() self.context["pages"], self.context["access"] = ( user_property_values["pages"], user_property_values["access"]) current_url = resolve(request.path_info).url_name if current_url in self.context["access"] or self.context["access"] == [ "All" ]: return render(request, self.template, self.context) elif "Register" in self.context["access"]: return redirect("Register") else: return redirect("Login")
def get(self, request): ''' to get the get request and show the templates for profile page :param request: :return: rendered page ''' self.context["candidate_data"] = {"name": "name"} user_properties = user_pages(request.user) user_property_values = user_properties.getUserViews() self.context["pages"], self.context["access"] = ( user_property_values["pages"], user_property_values["access"]) current_url = resolve(request.path_info).url_name if current_url in self.context["access"] or self.context["access"] == [ "All" ]: return render(request, self.template, self.context) elif "Register" in self.context["access"]: return redirect("Register") else: return redirect("Login")