Attrs cleanups (#37849)

This commit is contained in:
Ville Skyttä 2020-07-14 20:30:30 +03:00 committed by GitHub
parent 7e280e2b27
commit ac0dbb17af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 141 additions and 148 deletions

View file

@ -77,10 +77,10 @@ def _verify_otp(secret: str, otp: str, count: int) -> bool:
class NotifySetting:
"""Store notify setting for one user."""
secret = attr.ib(type=str, factory=_generate_secret) # not persistent
counter = attr.ib(type=int, factory=_generate_random) # not persistent
notify_service = attr.ib(type=Optional[str], default=None)
target = attr.ib(type=Optional[str], default=None)
secret: str = attr.ib(factory=_generate_secret) # not persistent
counter: int = attr.ib(factory=_generate_random) # not persistent
notify_service: Optional[str] = attr.ib(default=None)
target: Optional[str] = attr.ib(default=None)
_UsersDict = Dict[str, NotifySetting]