def slug_is_available(slug, job_category_model, job_category=None):
    """
    Determine whether the given slug is available for use and not a duplicate
    """
    JobCategory = job_category_model
    siblings = JobCategory.objects.all()
    if job_category:
        siblings = siblings.exclude(id=job_category.id)

    return not siblings.filter(slug=slug).exists()