Applies fixes after PR review

This commit is contained in:
Sergi Delgado Segura
2019-11-07 10:31:44 +00:00
parent 00a27b68e6
commit 99bda73eff
5 changed files with 15 additions and 38 deletions

View File

@@ -28,13 +28,13 @@ class Appointment:
hash_function = appointment_data.get("hash_function")
triggered = appointment_data.get("triggered")
if all(v is not None for v in [locator, start_time, end_time, dispute_delta, encrypted_blob_data, cipher,
hash_function, triggered]):
appointment = cls(locator, start_time, end_time, dispute_delta, encrypted_blob_data, cipher,
hash_function, triggered)
if any(v is None for v in [locator, start_time, end_time, dispute_delta, encrypted_blob_data, cipher,
hash_function, triggered]):
raise ValueError("Wrong appointment data, some fields are missing")
else:
raise ValueError("Wrong appointment data, some fields are missing")
appointment = cls(locator, start_time, end_time, dispute_delta, encrypted_blob_data, cipher, hash_function,
triggered)
return appointment