Skip to content

Commit

Permalink
Fix bug with leaving as a moderator when using token auth
Browse files Browse the repository at this point in the history
(cherry picked from commit 83323ef46f1ff17ec844b82fa5640a6cacbbc734)
  • Loading branch information
LilSpazJoekp committed Jan 25, 2021
1 parent c636604 commit 76cb9f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 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: 1 addition & 4 deletions asyncpraw/models/reddit/subreddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3011,10 +3011,7 @@ 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(username)
await self.remove(self.subreddit._reddit.config.username or self.subreddit._reddit.user.me())

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

0 comments on commit 76cb9f2

Please sign in to comment.