Ejemplo n.º 1
0
    def list_new(self):
        if not h.auth.is_logged_in():
            response.status_int = 401
            return "Unauthorized"
        if not h.auth.is_admin():
            response.status_int = 403
            return "Forbidden"

        addlist = sep.new_entries()
        titles = sep.get_titles()

        c.entries = []

        #perform a fuzzy match for each page and construct an appropriate link
        for sep_dir in addlist:
            #create a link for each entry in addlist()
            link = h.url(controller='entity',
                         action='new',
                         label=titles[sep_dir],
                         sep_dir=sep_dir)
            c.entries.append({
                'sep_dir': sep_dir,
                'title': titles[sep_dir],
                'link': link,
                'published': sep.published(sep_dir)
            })

        return render('admin/newentries.html')
Ejemplo n.º 2
0
 def test_sep_publishing_list(self):
     """
     SEP Publishing list
     Verify items are not already in database. Check sep_dir fields.
     """
     new = sep.new_entries()
     entries_in_db = 0
     for entry in new:
         if(len(Session.query(Entity).filter(Entity.sep_dir == entry).all()) > 0):
             entries_in_db += 1
             print entry
     self.assertEqual(entries_in_db, 0)
Ejemplo n.º 3
0
 def test_sep_publishing_list(self):
     """
     SEP Publishing list
     Verify items are not already in database. Check sep_dir fields at /admin
     """
     new = sep.new_entries()
     entries_in_db = 0
     for entry in new:
         if (len(
                 Session.query(Entity).filter(
                     Entity.sep_dir == entry).all()) > 0):
             entries_in_db += 1
             print entry
     self.assertEqual(entries_in_db, 0)
Ejemplo n.º 4
0
    def list_new(self):
        if not h.auth.is_logged_in():
            response.status_int = 401
            return "Unauthorized"
        if not h.auth.is_admin():
            response.status_int = 403
            return "Forbidden"

        addlist = sep.new_entries()
        titles = sep.get_titles()

        c.entries = []

        # perform a fuzzy match for each page and construct an appropriate link
        for sep_dir in addlist:
            # create a link for each entry in addlist()
            link = h.url(controller="entity", action="new", label=titles[sep_dir], sep_dir=sep_dir)
            c.entries.append(
                {"sep_dir": sep_dir, "title": titles[sep_dir], "link": link, "published": sep.published(sep_dir)}
            )

        return render("admin/newentries.html")