Example #1
0
    def GET_listing(self, events, **env):
        """Get a listing of live events by id."""
        if not is_api():
            self.abort404()
        if not events:
            return self.abort404()

        self.names = [e for e in events]
        return ListingController.GET_listing(self, **env)
Example #2
0
    def GET_listing(self, srname=None, include_managed=False, sort="all", **kw):
        self.sort = sort
        self.sr = None
        self.include_managed = include_managed

        if srname:
            try:
                self.sr = Subreddit._by_name(srname)
            except NotFound:
                pass
        return ListingController.GET_listing(self, **kw)
Example #3
0
 def GET_listing(self, sr=None, sort="", **env):
     if not c.user_is_loggedin or not c.user.email_verified:
         return self.redirect("/ad_inq")
     self.sort = sort
     self.sr = None
     if sr and sr == Frontpage.name:
         self.sr = Frontpage
     elif sr:
         try:
             self.sr = Subreddit._by_name(sr)
         except NotFound:
             pass
     return ListingController.GET_listing(self, **env)
Example #4
0
 def GET_listing(self, sr=None, sort="all", **env):
     if not c.user_is_loggedin or not c.user.email_verified:
         # never reached--see MinimalController.on_validation_error
         return self.redirect("/ad_inq")
     self.sort = sort
     self.sr = None
     if sr and sr == Frontpage.name:
         self.sr = Frontpage
     elif sr:
         try:
             self.sr = Subreddit._by_name(sr)
         except NotFound:
             pass
     return ListingController.GET_listing(self, **env)
Example #5
0
    def GET_listing(self, sr=None, sort="all", **env):
        if (sort in ('underdelivered', 'reported', 'house') and
            not c.user_is_sponsor):
            self.abort403()

        self.sort = sort
        self.sr = None
        if sr and sr == Frontpage.name:
            self.sr = Frontpage
        elif sr:
            try:
                self.sr = Subreddit._by_name(sr)
            except NotFound:
                pass
        return ListingController.GET_listing(self, **env)
Example #6
0
    def GET_listing(self, events, **env):
        """Get a listing of live events by id."""
        if not is_api():
            self.abort404()
        if not events:
            return self.abort404()

        self.names = []
        for item in self.splitter.split(events):
            # we originally overrode the fullname for live events to look like
            # regular IDs (no prefix). this snuck out to the world through this
            # api endpoint. to provide backwards compatibility, we'll prepend
            # the prefix if the requester doesn't send a proper fullname.
            if not item.startswith("LiveUpdateEvent_"):
                self.names.append("LiveUpdateEvent_" + item)
            else:
                self.names.append(item)

        return ListingController.GET_listing(self, **env)
Example #7
0
 def GET_listing(self, sort="all", **env):
     self.sort = sort
     return ListingController.GET_listing(self, **env)
Example #8
0
 def GET_listing(self, sort="", **env):
     if not c.user_is_loggedin or not c.user.email_verified:
         return self.redirect("/ad_inq")
     self.sort = sort
     return ListingController.GET_listing(self, **env)