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

feat: adds user.lock() and user.unlock() #123

Merged
merged 2 commits into from
Mar 22, 2024
Merged

feat: adds user.lock() and user.unlock() #123

merged 2 commits into from
Mar 22, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Mar 22, 2024

Screen.Recording.2024-03-22.at.11.06.29.mov

Resolves #100

Copy link

github-actions bot commented Mar 22, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
544 456 84% 80% 🟢

New Files

File Coverage Status
src/posit/connect/me.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
src/posit/connect/client.py 100% 🟢
src/posit/connect/users.py 92% 🟢
TOTAL 96% 🟢

updated for commit: 7999781 by action🐍

@tdstein tdstein merged commit 6f1a29f into main Mar 22, 2024
9 checks passed
@tdstein tdstein deleted the tdstein/100 branch March 22, 2024 16:20
)
url = urls.append_path(self.config.url, f"v1/users/{self.guid}/lock")
body = {"locked": True}
self.session.post(url, json=body)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this does not return the updated User record? That's too bad because updated_time should also be affected by this action. Not a huge deal but just wanted to note.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the 200 response body is empty for v1/users/{self.guid}/lock. Adding a subsequent refresh here seems reasonable though.

url = urls.append_path(self.config.url, f"v1/users/{self.guid}")
response = self.session.get(url)
self.update(**response.json())

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add User.lock() and .unlock()
3 participants