# -*- coding: utf-8 -*-

from django.core.exceptions import PermissionDenied # 403


class DisableQueryDeletedMixin(object):
    def get_object(self, queryset=None):
        obj = super(DisableQueryDeletedMixin, self).get_object(queryset)

        if obj.is_deleted:
            raise PermissionDenied

        return obj