#968 frontend: hide unlisted projects from homepage in RSS
Merged 4 years ago by praiskup. Opened 4 years ago by thrnciar.
copr/ thrnciar/copr rss-feed  into  master

@@ -8,9 +8,8 @@ 

  from coprs import models

  

  

- @rss_ns.route("/", defaults={"limit": 200})

- @rss_ns.route("/<int:limit>/")

- def rss(limit=200):

+ @rss_ns.route("/all", defaults={"limit": 200})

+ def rss_all(limit=200):

      """

      Simple route that returns all projects

      name, description, link to selected project
@@ -21,5 +20,18 @@ 

      coprs = CoprsLogic.get_all().order_by(models.Copr.id.desc()).limit(limit)

  

      answer = render_template("rss/rss.xml", coprs=coprs)

+     return Response(answer, mimetype="text/xml")

+ 

+ 

+ @rss_ns.route("/", defaults={"limit": 200})

+ @rss_ns.route("/<int:limit>/")

+ def rss(limit=200):

+     """

+     Simple route that returns all projects

+     name, description, link to selected project

+     as rss feed except projects hidden from homepage

+     """

  

+     coprs = CoprsLogic.get_multiple(include_unlisted_on_hp=False).order_by(models.Copr.id.desc()).limit(limit)

+     answer = render_template("rss/rss.xml", coprs=coprs)

      return Response(answer, mimetype="text/xml")

This commit removes unlisted project at homepage in RSS and
adds new RSS route /rss/all/ to show also unlisted projects.

Can you please remove the four new-lines above, and add one below (between the fuction calls)?

isn't the include_deleted=False default? If it is not, shouldn't we put that option even to rss_all()?

You are right include_delete=False is default, I will remove it.

rebased onto 6f7d4bc27ae225ef26c00c9e078b008fcf5e2d91

4 years ago

rebased onto f18b215295446633205f2a61adbde3f50a2ce8f3

4 years ago

rebased onto 3ac531b

4 years ago

Metadata Update from @msuchy:
- Pull-request tagged with: can-be-merged

4 years ago

Commit 43e3f7c fixes this pull-request

Pull-Request has been merged by praiskup

4 years ago