[autotest] Require lock reason to lock device
When locking a device, a locking reason now must be provided.
This applies to both adding a new device, and modifying an
existing device from both the web frontend and the atest
command-line tool.
BUG=chromium:336805
DEPLOY=migrate
TEST=Tested adding locked/unlocked devices and locking/unlocking devices
from both the web frontend and using the 'atest host ...' command-line tools.
Change-Id: I3a8cd8891a2999f026dd709ae8a79e2b8cbc251a
Reviewed-on: https://chromium-review.googlesource.com/267595
Tested-by: Matthew Sartori <msartori@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Matthew Sartori <msartori@chromium.org>
diff --git a/frontend/afe/rdb_model_extensions.py b/frontend/afe/rdb_model_extensions.py
index 741b639..519ec7b 100644
--- a/frontend/afe/rdb_model_extensions.py
+++ b/frontend/afe/rdb_model_extensions.py
@@ -196,6 +196,7 @@
default=host_protections.default)
lock_time = dbmodels.DateTimeField(null=True, blank=True, editable=False)
dirty = dbmodels.BooleanField(default=True, editable=settings.FULL_ADMIN)
+ lock_reason = dbmodels.CharField(max_length=255, blank=True, default='')
class Meta: