-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added council suggestions for comparison tool #698
base: master
Are you sure you want to change the base?
Conversation
40c63bc
to
69e5f87
Compare
@lucascumsille I’ve wired this up, so that a maximum of 5 overall related councils are passed to the template, removing any that are already selected for comparison. I simplified some of the wording, and used flex layout for the links, rather than concatenating them into a sentence with commas. |
Marking as ready for review by @struan, so he can check I my Python isn’t too horrendous, and work out whether we should fix the linting errors or not. |
2253446
to
e68ce6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good.
I've pushed some commits to update the black version and fix the resulting linting issues. We were using an old version so I've updated it to the latest version.
scoring/views.py
Outdated
context["similar_councils"] = [ | ||
sc | ||
for sc in group["councils"] | ||
if sc.slug not in {score.council.slug for score in comparisons} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw I've pushed a small fixup so we're not regenerating this set every time
context["comparisons"] = comparisons | ||
|
||
for group in council.get_related_councils(5): | ||
if group["type"].slug == "composite": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this only apply if it's composite?
3bdc2a9
to
b8bf1cb
Compare
Fixes: #686
I left some comments regarding things that are pending, but front-end related I think it should be ready.
Preview here: