Properties rework, States, StatesDefinitions, DeviceLog, and Notes #37

Merged
pedro merged 119 commits from feature/states into main 2025-02-10 12:05:58 +00:00
Showing only changes of commit 5a448755c2 - Show all commits

View file

@ -185,9 +185,9 @@ class EraseServerForm(forms.Form):
self.pk = None
self.uuid = kwargs.pop('uuid', None)
self.user = kwargs.pop('user')
instance = SystemProperty.objects.filter(
instance = UserProperty.objects.filter(
uuid=self.uuid,
type=SystemProperty.Type.ERASE_SERVER,
type=UserProperty.Type.ERASE_SERVER,
key='ERASE_SERVER',
owner=self.user.institution
).first()
@ -200,9 +200,9 @@ class EraseServerForm(forms.Form):
def clean(self):
self.erase_server = self.cleaned_data.get('erase_server', False)
self.instance = SystemProperty.objects.filter(
self.instance = UserProperty.objects.filter(
uuid=self.uuid,
type=Property.Type.ERASE_SERVER,
type=UserProperty.Type.ERASE_SERVER,
key='ERASE_SERVER',
owner=self.user.institution
).first()
@ -221,9 +221,9 @@ class EraseServerForm(forms.Form):
if self.instance:
return
SystemProperty.objects.create(
UserProperty.objects.create(
uuid=self.uuid,
type=Property.Type.ERASE_SERVER,
type=UserProperty.Type.ERASE_SERVER,
key='ERASE_SERVER',
value=self.erase_server,
owner=self.user.institution,