Skip to content

Commit 0165a8d

Browse files
committed
do not associate find_vanity with the _vanity
1 parent 0132283 commit 0165a8d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

integration/tests/posit/connect/test_vanities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def test_destroy(self):
6666

6767
# Delete
6868
vanity.destroy()
69+
content.reset_vanity()
6970
assert content.vanity is None
7071

7172
# Cleanup

src/posit/connect/vanities.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def vanity(self) -> Optional[str]:
142142

143143
try:
144144
self._vanity = self.find_vanity()
145+
self._vanity._after_destroy = self.reset_vanity
145146
return self._vanity["path"]
146147
except ClientError as e:
147148
if e.http_status == 404:
@@ -232,4 +233,4 @@ def find_vanity(self) -> Vanity:
232233
"""
233234
response = self.params.session.get(self._endpoint)
234235
result = response.json()
235-
return Vanity(self.params, after_destroy=self.reset_vanity, **result)
236+
return Vanity(self.params, **result)

0 commit comments

Comments
 (0)