Skip to content

Enhance validation and fix execom roster management - #3074

Closed
DevWithPranav wants to merge 8 commits into
feat/campusfrom
production
Closed

Enhance validation and fix execom roster management#3074
DevWithPranav wants to merge 8 commits into
feat/campusfrom
production

Conversation

@DevWithPranav

Copy link
Copy Markdown
Collaborator

No description provided.

awindsr and others added 8 commits July 21, 2026 09:48
feat: add validation for interest groups selection limit in UserDetai…
feat: Create triage workflow and enhance task management features
fix(campus): execom roster no longer leaks non-execom UserRoleLink rows
fix: Scope execom roster to actual appointments and fix leaks
fix: Add validation for interest groups and fix execom roster leaks
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the campus execom role blacklist with explicit role classification. The main changes are:

  • Adds is_execom_role to the Role model.
  • Marks newly created custom and IG campus-lead roles.
  • Rejects execom titles already used by non-execom roles.
  • Filters campus rosters by the new role flag.

Confidence Score: 4/5

The role schema and historical execom classification need fixes before merging.

  • The current database schema lacks the column used by new reads and writes.
  • Existing legitimate execom roles will remain false and disappear from campus rosters without a backfill.

db/user.py and api/dashboard/campus/events_views.py

Important Files Changed

Filename Overview
db/user.py Adds an unmanaged model field without the required database schema artifact.
api/dashboard/campus/events_views.py Switches roster selection to explicit role classification without backfilling historical roles.
api/dashboard/campus/dash_campus_helper.py Classifies newly created IG roles, but creation defaults do not update existing rows.
api/dashboard/ig/dash_ig_view.py Adds classification values when creating new IG roles.

Reviews (1): Last reviewed commit: "Merge pull request #3061 from gtech-mule..." | Re-trigger Greptile

Comment thread db/user.py
created_by = models.ForeignKey(User, on_delete=models.SET(settings.SYSTEM_ADMIN_ID), db_column='created_by',
related_name='role_created_by')
created_at = models.DateTimeField(auto_now_add=True)
is_execom_role = models.BooleanField(default=False)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Unmanaged Column Is Missing

Role is unmanaged, but this PR does not add is_execom_role to schema.sql or an alter script. Deploying against the current schema makes the new role filters and writes fail with an unknown-column database error.

Comment on lines 198 to +200
execom_links = UserRoleLink.objects.filter(
user_id__in=campus_user_ids
).exclude(
role__title__in=BLACKLIST_ROLES
user_id__in=campus_user_ids,
role__is_execom_role=True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Historical Execom Roles Disappear

Existing Campus Lead, Lead Enabler, Enabler, and IG campus-lead rows predate this flag and are not backfilled here. Once the column exists with its false default, this positive filter removes their current holders from GET /campus/execom/, whereas the previous blacklist included them.

@alvin-dennis alvin-dennis moved this from Done to Won't Do in µLearn Delivery Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Won't Do

Development

Successfully merging this pull request may close these issues.

4 participants