Skip to content

Commit

Permalink
Fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jun 22, 2023
1 parent ce82e88 commit 4ece7e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions funnel/models/email_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def is_exclusive(self) -> bool:
)

def is_available_for(self, owner: Optional[User]) -> bool:
"""Return True if this EmailAddress is available for the given owner."""
"""Return True if this EmailAddress is available for the proposed owner."""
for backref_name in self.__exclusive_backrefs__:
for related_obj in getattr(self, backref_name):
curr_owner = getattr(related_obj, related_obj.__email_for__)
Expand Down Expand Up @@ -615,9 +615,10 @@ def validate_for(
],
]:
"""
Validate whether the email address is available to the given owner.
Validate whether the email address is available to the proposed owner.
Returns None if available without issues, or a string value indicating the concern:
Returns None if available without issues, or a string value indicating the
concern:
1. 'taken': Email address has another owner
2. 'nomx': Email address is available, but has no MX records
Expand Down
8 changes: 4 additions & 4 deletions funnel/models/phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def is_exclusive(self) -> bool:
)

def is_available_for(self, owner: Optional[User]) -> bool:
"""Return True if this PhoneNumber is available for the given owner."""
"""Return True if this PhoneNumber is available for the proposed owner."""
for backref_name in self.__exclusive_backrefs__:
for related_obj in getattr(self, backref_name):
curr_owner = getattr(related_obj, related_obj.__phone_for__)
Expand Down Expand Up @@ -670,10 +670,10 @@ def validate_for(
new: bool = False,
) -> Optional[Literal['taken', 'invalid', 'not_new', 'blocked']]:
"""
Validate whether the phone number is available to the given owner.
Validate whether the phone number is available to the proposed owner.
Returns False if the number is blocked or in use by another owner, True if
available without issues, or a string value indicating the concern:
Returns None if available without issues, or a string value indicating the
concern:
1. 'taken': Phone number has another owner
2. 'not_new': Phone number is already attached to owner (if `new` is True)
Expand Down

0 comments on commit 4ece7e3

Please sign in to comment.