You can do something like this:

```python
docs = Document.objects.filter(
    locale=locale,
    is_template_False,
    category__in=(CATEGORIES[0][0], CATEGORIES[1][0]))

if locale == settings.WIKI_DEFAULT_LANGUAGE:
    docs = docs.filter(products__id=product.id)
else:
    docs = docs.filter(parent__products__id=product.id)
```

This makes it clearer what is affected by the branch and what is common to the two cases.