KristianOellegaard/django-hvad — pull request #183 by spectras (2014-05-26 14:07:50+00:00)
Title: delete_translations does not delete (some) translations

Simple example:
```pycon
>>> qs = Normal.objects.language('en').filter(shared_field='Shared1')
>>> qs.delete_translations()
>>> QuerySet(model=qs.model, using=qs._db).filter(master__isnull=True).count()
1
```
__Result:__ the targeted translation still lives. It is not obvious as it has its `master_id` set to `NULL` so it effectively disappears. But it stays around, and its unchained spirit might haunt some query results. Namely, issuing a query that uses no shared field and uses the same language will have it appear.

__Causes:__ the method first `update()`s the translations to set their `master_id` to NULL. Therefore, the subsequent `delete()` will not find them when filtering on `master__shared_field`.

__Fix:__
- Possibility 1: well, I wonder what the point of setting `master_id` to NULL is. Why do we not simply DELETE th objects?
- Possibility 2: if there is really a good reason to update first, then we shoud just ``QuerySet(model=self.model, using=self._db).filter(master__isnull=True).delete()``.