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

In order to delete a user, you must first remove them from any schedu… #40

Merged
merged 1 commit into from
Feb 3, 2016
Merged

In order to delete a user, you must first remove them from any schedu… #40

merged 1 commit into from
Feb 3, 2016

Conversation

JohnTheodore
Copy link

…les they're in. You can find the schedules a particular user is in with api/v1/users/user_id/schedules. This is faster than grabbing all schedules and digging through to find a specific user.

self.log_entries = LogEntries(self.pagerduty, self)


class UserSchedules(Collection):
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you find that this and UserEscalationPolicies was necessary? A quick test with the existing Schedules and EscalationPolicies collections seemed to work fine.

Copy link
Author

Choose a reason for hiding this comment

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

So perhaps I've overlooked something, but it didn't seem like the Schedules allowed me to filter for only schedules that include a specific user?

Copy link
Contributor

Choose a reason for hiding this comment

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

To be more clear, adding this

        self.schedules = Schedules(self.pagerduty, self)
        self.escalation_policies = EscalationPolicies(self.pagerduty, self)

to the User container seemed to work without needing the two new collection classes you added.

@gmjosack
Copy link
Contributor

gmjosack commented Feb 3, 2016

Thanks for added this! I've wanted something like this but I haven't seen anything in the API docs. Do you have a reference where you found this was available?

@JohnTheodore
Copy link
Author

I poked the support people today asking why this isn't in the api. They told me it was, but undocumented. It will be documented 'soon'. :p

or escalation policies they're in. You can find the schedules a particular user is in with api/v1/users/user_id/schedules. This is faster than grabbing all schedules and digging through to find a specific user.
@JohnTheodore
Copy link
Author

ok, I made the changes you suggested and rebased to one commit. Any other changes?

gmjosack added a commit that referenced this pull request Feb 3, 2016
In order to delete a user, you must first remove them from any schedu…
@gmjosack gmjosack merged commit 747143c into dropbox:master Feb 3, 2016
@gmjosack
Copy link
Contributor

gmjosack commented Feb 3, 2016

Looks good. Thanks!

I've pushed this to PyPI as pygerduty-0.32.1

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.

None yet

2 participants