Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is the Learning Lab RFP (closed, not promoted) still showing up on the front page at the bottom? #633

Closed
danblah opened this issue Oct 1, 2018 · 3 comments · Fixed by #1169
Assignees
Labels
Type: Bug Bugs! Things that are broken :-/
Milestone

Comments

@danblah
Copy link
Contributor

danblah commented Oct 1, 2018

No description provided.

@danblah danblah added Type: Bug Bugs! Things that are broken :-/ manage labels Oct 1, 2018
@danblah danblah added this to the Current release milestone Oct 1, 2018
@frjo
Copy link
Member

frjo commented Oct 3, 2018

I do not think there are any features for removing content from pages based on application status on the other end. @todd-dembrey maybe can correct me if I'm wrong here.

@todd-dembrey
Copy link
Contributor

We do not have a way to easily grab the related "open" funds/labs/rfp as part of a queryset from the public site. We have tried to avoid adding too much coupling between the sites.

The following function handles to population of the lists, specifically line 131.
https://github.com/OpenTechFund/opentech.fund/blob/47c90ea4cbe431a65267fd276606742797e9592c/opentech/public/home/models.py#L126-L132

You could use change this method to get all of the related objects and yield while a counter is less than a value whilst checking for .is_open
https://github.com/OpenTechFund/opentech.fund/blob/47c90ea4cbe431a65267fd276606742797e9592c/opentech/public/funds/models.py#L182

This is going to be less performant, but much easier to implement.

e.g.

extra_qs = page_type.objects.public().live().exclude(id__in=selected)
displayed = 0
for page in self.sorted_by_deadline(extra_qs):
    if page.is_open:
        yield page
        displayed += 1
    if displayed >= extra_needed:
        break

see below for some of the complexity about adding queries to the Applications objects:
https://github.com/OpenTechFund/opentech.fund/blob/47c90ea4cbe431a65267fd276606742797e9592c/opentech/apply/funds/models/applications.py#L29-L34

@danblah danblah modified the milestones: 2019-Q1, Hotfix/Bugs Mar 7, 2019
@danblah
Copy link
Contributor Author

danblah commented Apr 23, 2019

SO ANNOYING, FIX THIS! I want that Requests for Partners section on the home page to disappear if there are no actual open requests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bugs! Things that are broken :-/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants