def __init__(self, request, dates): try: self.location = Location.objects.get( pk=int(request.POST['drill_key'])) except: self.location = Location.tree.root_nodes()[0] Report.__init__(self, request, dates)
def __init__(self, request, dates): try: self.location = get_location_for_user(request.user) except: pass if self.location is None: self.location = Location.tree.root_nodes()[0] Report.__init__(self, request, dates)
def __init__(self, request, dates): try: self.location = Location.objects.get(pk=int(request.POST['drill_key'])) except: self.location = Location.tree.root_nodes()[0] Report.__init__(self, request, dates)