-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issues with and related to
PatientAssetBed
view (#1325)
* fixes #1324, disallow asset type modifications * fixes #1323, rectify bed_is_occupied filter for patient asset bed view * fixes #1322, cascade delete `AssetBed` * fixes #1319, disallow linking asset beds of same asset type * fix queryset delete of AssetBed * oops, forgot to run the migration :) * delete assetbed before asset/bed * only allow setting asset class on creation (or updation if asset class is not set)
- Loading branch information
1 parent
0cbff7c
commit 831c216
Showing
6 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 2.2.11 on 2023-05-29 13:37 | ||
|
||
from django.db import migrations | ||
from django.db.models import Q | ||
|
||
|
||
class Migration(migrations.Migration): | ||
def delete_asset_beds(apps, schema_editor): | ||
AssetBed = apps.get_model("facility", "AssetBed") | ||
AssetBed.objects.filter(Q(asset__deleted=True) | Q(bed__deleted=True)).update( | ||
deleted=True | ||
) | ||
|
||
dependencies = [ | ||
("facility", "0358_auto_20230524_1853"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(delete_asset_beds), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters