Skip to content

Commit 0132283

Browse files
committed
fix: ensure the vanity is known before deleting it
1 parent abb26ba commit 0132283

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/posit/connect/vanities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def vanity(self) -> None:
184184
--------
185185
reset_vanity
186186
"""
187+
self.vanity
187188
if self._vanity:
188189
self._vanity.destroy()
189190
self.reset_vanity()

tests/posit/connect/test_vanities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_vanity_deleter(self):
109109
url = Url(base_url)
110110
params = ResourceParameters(session, url)
111111
content = VanityMixin(params, guid=guid)
112-
content._vanity = Vanity(params, content_guid=guid)
112+
content._vanity = Vanity(params, path=Mock(), content_guid=guid, created_time=Mock())
113113
del content.vanity
114114

115115
assert content._vanity is None

0 commit comments

Comments
 (0)