Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_counties(self):
return intake.models.County.objects.filter(
organizations__submissions=self).distinct()
def get_live_counties_and_orgs():
live_orgs = Organization.objects.filter(
is_live=True, is_receiving_agency=True)
live_counties = County.objects.filter(
organizations__in=live_orgs).distinct()
return live_counties, live_orgs
def get_counties(self):
return County.objects.filter(
organizations__submissions=self).distinct()
def get_counties(self):
session_data = self.get_session_data()
county_slugs = session_data.get('counties', [])
return models.County.objects.filter(slug__in=county_slugs).all()
def get_counties_from_county_names_string(county_names_string):
"""converts an oxford comma string of county names in to
county model instances
"""
return models.County.objects.filter(
name__in=oxford_comma_text_to_list(county_names_string))
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
county_slugs = self.session_data.get('counties', [])
counties = models.County.objects.filter(slug__in=county_slugs).all()
context.update(
counties=counties,
county_list=[county.name + " County" for county in counties])
return context