Skip to content

Commit

Permalink
Merge pull request #1070 from jarhill0/fix-collections
Browse files Browse the repository at this point in the history
Fix issues with #1067
  • Loading branch information
bboe committed May 12, 2019
2 parents 6603ac3 + f7f823c commit be1dc77
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions praw/models/reddit/collections.py
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit be1dc77

Please sign in to comment.