renamed property variable to prop
This commit is contained in:
parent
38a2fd50dc
commit
88f535da5c
|
@ -115,7 +115,7 @@ class NewSnapshotView(ApiMixing):
|
|||
text = "fail: It is not possible to parse snapshot"
|
||||
return JsonResponse({'status': text}, status=500)
|
||||
|
||||
property = SystemProperty.objects.filter(
|
||||
prop = SystemProperty.objects.filter(
|
||||
uuid=ev_uuid,
|
||||
# TODO this is hardcoded, it should select the user preferred algorithm
|
||||
key="hidalgo1",
|
||||
|
@ -123,7 +123,7 @@ class NewSnapshotView(ApiMixing):
|
|||
).first()
|
||||
|
||||
|
||||
if not property:
|
||||
if not prop:
|
||||
logger.error("Error: No property for uuid: %s", ev_uuid)
|
||||
return JsonResponse({'status': 'fail'}, status=500)
|
||||
|
||||
|
|
|
@ -75,12 +75,12 @@ class Device:
|
|||
if not self.uuids:
|
||||
self.get_uuids()
|
||||
|
||||
properties = UserProperty.objects.filter(
|
||||
user_properties = UserProperty.objects.filter(
|
||||
uuid__in=self.uuids,
|
||||
owner=self.owner,
|
||||
type=UserProperty.Type.DOCUMENT
|
||||
)
|
||||
return properties
|
||||
return user_properties
|
||||
|
||||
def get_uuids(self):
|
||||
for a in self.get_properties():
|
||||
|
@ -113,9 +113,9 @@ class Device:
|
|||
properties = self.get_properties()
|
||||
if not properties.count():
|
||||
return
|
||||
property = properties.first()
|
||||
prop = properties.first()
|
||||
|
||||
self.last_evidence = Evidence(property.uuid)
|
||||
self.last_evidence = Evidence(prop.uuid)
|
||||
|
||||
def is_eraseserver(self):
|
||||
if not self.uuids:
|
||||
|
@ -123,13 +123,13 @@ class Device:
|
|||
if not self.uuids:
|
||||
return False
|
||||
|
||||
property = UserProperty.objects.filter(
|
||||
prop = UserProperty.objects.filter(
|
||||
uuid__in=self.uuids,
|
||||
owner=self.owner,
|
||||
type=UserProperty.Type.ERASE_SERVER
|
||||
).first()
|
||||
|
||||
if property:
|
||||
if prop:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
@ -80,15 +80,15 @@ def create_property(doc, user, commit=False):
|
|||
'value': doc['CUSTOMER_ID'],
|
||||
}
|
||||
if commit:
|
||||
property = SystemProperty.objects.filter(
|
||||
prop = SystemProperty.objects.filter(
|
||||
uuid=doc["uuid"],
|
||||
owner=user.institution,
|
||||
)
|
||||
|
||||
if property:
|
||||
if prop:
|
||||
txt = "Warning: Snapshot %s already registered (system property exists)"
|
||||
logger.warning(txt, doc["uuid"])
|
||||
return property
|
||||
return prop
|
||||
|
||||
return SystemProperty.objects.create(**data)
|
||||
|
||||
|
|
Loading…
Reference in a new issue