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

Fix generating Powerpoint report header #431

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

JohnMwashuma
Copy link
Member

@JohnMwashuma JohnMwashuma commented Aug 6, 2024

Fixes #430

Task checklist


  • Group stations by station ids then get their properties values.
  • Remove station number and registrants annotation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.40%. Comparing base (19f57c9) to head (b859afc).

Files Patch % Lines
...ally/views/reports/administrative_areas_reports.py 80.00% 1 Missing ⚠️
...ly/views/reports/turnout_reports_by_admin_areas.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master     #431    +/-   ##
========================================
  Coverage   80.40%   80.40%            
========================================
  Files         139      144     +5     
  Lines        9225     9389   +164     
========================================
+ Hits         7417     7549   +132     
- Misses       1808     1840    +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JohnMwashuma JohnMwashuma requested a review from lincmba August 6, 2024 13:50
)

if form_states.count() == 1 and \
form_states[0] == FormState.ARCHIVED:
stations_processed += 1
registrants_in_processed_stations += \
station.get('num_registrants')
station_obj.registrants
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could raise AttributeError if station_obj is None

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, so I have made sure we reuse the tally stations queryset used when creating stations_by_id that's used when defining station_obj. This will ensure we never encounter such an error

)
voters = 0
stations_processed = 0
registrants_in_processed_stations = 0
for station in station_ids_by_race:
station_obj = stations_by_id.get(station.get('id'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same Could raise AttributeError if station.get('id') returns None

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above response also applies here

@JohnMwashuma JohnMwashuma requested a review from lincmba August 6, 2024 16:31
@JohnMwashuma JohnMwashuma merged commit d78fcd9 into master Aug 7, 2024
8 checks passed
@JohnMwashuma JohnMwashuma deleted the fix-ppt-report-header-generation branch August 7, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Powerpoint error generation
3 participants