Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify metadata deletion message. #754

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions stripe/stripe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ def __delattr__(self, k):
def __setitem__(self, k, v):
if v == "":
raise ValueError(
"You cannot set %s to an empty string. "
"We interpret empty strings as None in requests."
"You may set %s.%s = None to delete the property"
% (k, str(self), k)
"You cannot set %s to an empty string on this object. "
"The empty string is treated specially in our requests. "
"If you'd like to delete the property using the save() method on this object, you may set %s.%s = None. "
"Alternatively, you can pass %s='' to delete the property when using a resource method such as modify()."
% (k, str(self), k, k)
)

# Allows for unpickling in Python 3.x
Expand Down