Skip to content

Commit

Permalink
Merge pull request #35 from praw-dev/moderator_leave
Browse files Browse the repository at this point in the history
Fix bug with leaving as a moderator when using token auth
  • Loading branch information
LilSpazJoekp committed Jan 25, 2021
2 parents c636604 + 760d7bc commit f2ce6db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Unreleased

**Fixed**

* An issue where leaving as a moderator fails if you are using token auth.
* A bug where if you call `.parent()` on a comment it clears its replies.
* An issue where performing a deepcopy on an :class:`.RedditBase` object will fail.
* Some cases where streams yield the same item multiple times. This cannot be
Expand Down
5 changes: 2 additions & 3 deletions asyncpraw/models/reddit/subreddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3011,10 +3011,9 @@ async def leave(self):
await subreddit.moderator.leave()
"""
username = self.subreddit._reddit.config.username or str(
await self.subreddit._reddit.user.me()
await self.remove(
self.subreddit._reddit.config.username or self.subreddit._reddit.user.me()
)
await self.remove(username)

async def remove_invite(self, redditor):
"""Remove the moderator invite for ``redditor``.
Expand Down

0 comments on commit f2ce6db

Please sign in to comment.