Skip to content

Commit

Permalink
make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed May 11, 2024
1 parent a92c254 commit 825673e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/django_opfield/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def __init__(
def with_secret(cls, *args: Any, **kwargs: Any) -> tuple[OPField, property]:
op_uri = cls(*args, **kwargs)

@property
def secret(self: models.Model) -> str | None:
def secret_getter(self: models.Model) -> str | None:
if not app_settings.OP_SERVICE_ACCOUNT_TOKEN:
msg = "OP_SERVICE_ACCOUNT_TOKEN is not set"
raise ValueError(msg)
Expand All @@ -50,10 +49,10 @@ def secret(self: models.Model) -> str | None:
secret = result.stdout.decode("utf-8").strip()
return secret

@secret.setter
def secret(self: models.Model, value: str) -> None:
def secret_setter(self: models.Model, value: str) -> None:
raise NotImplementedError("OPField does not support setting secret values")

secret = property(secret_getter, secret_setter)
return op_uri, secret

@override
Expand Down

0 comments on commit 825673e

Please sign in to comment.