def embeddable_sr(thing): if isinstance(thing, Subreddit): sr = thing else: try: sr = Subreddit._byID(thing.sr_id) if thing.sr_id else None except NotFound: sr = None return sr if (sr is not None and sr.type not in Subreddit.private_types) else False
def embeddable_sr(thing): if isinstance(thing, Subreddit): sr = thing else: try: sr = Subreddit._byID(thing.sr_id) if thing.sr_id else None except NotFound: sr = None return sr if (sr is not None and sr.type not in DISALLOWED_SR_TYPES) else False
def embeddable_sr(thing): if isinstance(thing, Subreddit): sr = thing else: try: sr = Subreddit._byID(thing.sr_id, data=True) if thing.sr_id else None except NotFound: sr = None return sr if (sr is not None and sr.type not in Subreddit.private_types) else False
def embeddable_sr(thing): if isinstance(thing, Subreddit): sr = thing else: try: sr = Subreddit._byID(thing.sr_id, data=True) if thing.sr_id else None except NotFound: sr = None if (sr is not None and sr.type not in Subreddit.private_types and not sr.quarantine): return sr else: return False