From f7f823c21f9d050123a7fce524badc3eb67c44d9 Mon Sep 17 00:00:00 2001 From: jarhill0 Date: Sun, 12 May 2019 10:52:49 -0400 Subject: [PATCH] Fix issues with #1067 - Don't index into the string_types tuple - Use Reddit.config to get submission kind rather than Objector.kind --- praw/models/reddit/collections.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/praw/models/reddit/collections.py b/praw/models/reddit/collections.py index ad3bb2879..f62b3bf68 100644 --- a/praw/models/reddit/collections.py +++ b/praw/models/reddit/collections.py @@ -210,13 +210,15 @@ def _post_fullname(self, post): """ if isinstance(post, Submission): return post.fullname - elif not isinstance(post, string_types[0]): + elif not isinstance(post, string_types): raise TypeError( "Cannot get fullname from object of type {}.".format( type(post) ) ) - if post.startswith("{}_".format(self._submission_kind)): + if post.startswith( + "{}_".format(self._reddit.config.kinds["submission"]) + ): return post try: return self._reddit.submission(url=post).fullname @@ -230,9 +232,6 @@ def __init__(self, reddit, collection_id): """ super(CollectionModeration, self).__init__(reddit, _data=None) self.collection_id = collection_id - self._submission_kind = self._reddit._objector.kind( - self._reddit.submission(id="fake") - ) def add_post(self, submission): """Add a post to the collection.