---
url: "https://vueda.dev/v3/reference/api/py/vueda.core.viewsets/DeactivateActionViewSetMixin.md"
title: "DeactivateActionViewSetMixin"
---

# DeactivateActionViewSetMixin

## Overview

A ViewSet mixin that allows you to deactivate a model inheriting from `ActivatableBaseModel`.

A bulk request names its rows in a ``pks`` body. ``VuedaViewSet.get_bulk_queryset`` converts
the keys and applies the row-level and object permission checks for ``update``, the checks that
a single-object request makes. A key that names no row, or a row that the request may not
change, answers 400 before anything changes.

Both actions consult ``get_warnings_for_object``/``get_warnings`` (provided by
``WarningConfirmationMixin``, so any ``VuedaViewSet``) after validation and before the write,
gating the write behind a 409 confirmation when warnings are reported.

## `activate` {#activate}

### Signature {#activate-signature}

`activate(self, request, pk)`

#### Parameters {#activate-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="activate-param-request">request</span> |  | yes |  |  |
| <span id="activate-param-pk">pk</span> |  | no | `None` |  |

### Source {#activate-source}

`server/vueda/core/viewsets/__init__.py:1529`

## `deactivate` {#deactivate}

### Signature {#deactivate-signature}

`deactivate(self, request, pk)`

#### Parameters {#deactivate-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="deactivate-param-request">request</span> |  | yes |  |  |
| <span id="deactivate-param-pk">pk</span> |  | no | `None` |  |

### Source {#deactivate-source}

`server/vueda/core/viewsets/__init__.py:1486`

## Source

`server/vueda/core/viewsets/__init__.py:1472`
