Skip to content

Commit 8eb19e7

Browse files
committed
Calculate target fields for Password entity bases on its type
Signed-off-by: Anton Kremenetsky <anton.kremenetsky@gmail.com>
1 parent 44994d3 commit 8eb19e7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

genesis_core/secret/dm/models.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def get_resource_target_fields(self) -> tp.Set[str]:
8585
8686
Refer to the Resource model for more details about target fields.
8787
"""
88-
return {
88+
fields = {
8989
"method",
9090
"constructor",
9191
"name",
@@ -94,6 +94,11 @@ def get_resource_target_fields(self) -> tp.Set[str]:
9494
"description",
9595
}
9696

97+
if sc.SecretMethod.MANUAL == self.method:
98+
fields.add("value")
99+
100+
return fields
101+
97102
@classmethod
98103
def get_new_passwords(cls, limit: int = c.DEFAULT_SQL_LIMIT) -> tp.List["Password"]:
99104
return cls.get_new_entities(cls.__tablename__, sc.PASSWORD_KIND, limit=limit)

0 commit comments

Comments
 (0)