Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; no new actionable issue was found. Reviews (5) · Last reviewed commit: "fix: limit regional users to their own c..." · Reviewed by Greptile |
|
@barredterra Can you check the permissons for the requirement: "Der Bericht ist nur ab Ebene Regionlaverband aufwärts sichtbar / nutzbar" |
There was a problem hiding this comment.
Thanks, the report is small and easy to read. Filters, approved-only fishing days summed per organization, and visibility for regional and state roles all match the ticket. A few points:
Should fix
-
Clubs that have local groups can't be picked in the Organization filter (
fishing_days_by_organization.js). The filter only offers organizations withis_group: 0. A club that has local groups below it is a group itself, so it is excluded. Catch Log Entry puts no such limit on itsorganizationfield, so entries can be booked on such a club. These clubs then appear when the filter is empty, but you can't select them. Suggestion: drop theget_query, or limit it to the user's own regional association, aswater_body_development.jsdoes withfrappe.boot.landa.regional_organization. -
The test was removed (
refactor: remove test file). It covered both the per-organization totals and the regional restriction, which is the security requirement of the ticket. Unless there was a specific reason, please bring it back, perhaps with test data that matches the fixtures.
Worth checking
-
State employees may only see their own region.
get_datafilters byget_current_member_data().regional_organizationregardless of role. A state employee whose member record sits under a regional association will only see that region's data.water_body_development.pydoes the same, so this may be intended.add_or_filtersinreport/utils.pyskips the filter forSTATE_ROLES. Which behaviour do we want here? -
Local groups (e.g.
XXX-002-01) get their own rows instead of being added to their parent club. The ticket talks about clubs, so we should clarify whether groups should be rolled up.
Nit
- The join to Organization isn't needed. Catch Log Entry already stores
organization_name(fetched from the organization), soentry.organization_namegives the same result.
|
One more suggestion: sort by fishing days, highest first, instead of by organization name. The purpose of the report is to see which clubs use a water body the most, so those should be at the top: .orderby(Sum(entry.fishing_days), order=frappe.qb.desc)The total row is not affected, and users can still sort by name in the report view. |
# Conflicts: # landa/locale/de.po # landa/locale/main.pot
… in organization filter
|
Here is a summary of the
Similar Change-Size Groups
|
| Status | Msgid | Previous | Current |
|---|---|---|---|
| added | Fishing Days by Organization | empty | Angeltage nach Verein |
|
| Status | Previous | Current |
|---|---|---|
| added | empty | Fishing Days by Organization |
No description provided.