add & fix stakr holeders default
This commit is contained in:
18
apps/pos_device/migrations/0074_stakeholders_default.py
Normal file
18
apps/pos_device/migrations/0074_stakeholders_default.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0 on 2025-09-14 08:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pos_device', '0073_device_mac'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='stakeholders',
|
||||
name='default',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
||||
@@ -272,6 +272,7 @@ class StakeHolders(BaseModel):
|
||||
related_name='pos_stake_holders',
|
||||
null=True
|
||||
)
|
||||
default = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return f'Device: {self.assignment.device.serial}-organization: {self.organization.name}'
|
||||
|
||||
@@ -238,6 +238,7 @@ class DeviceAssignmentViewSet(viewsets.ModelViewSet, SoftDeleteMixin):
|
||||
assignment=assignment,
|
||||
device=assignment.device,
|
||||
organization=assignment.client.organization,
|
||||
default=True
|
||||
)
|
||||
|
||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||
|
||||
Reference in New Issue
Block a user