Skip to content

fix: Add validation for interest groups and fix execom roster leaks#3061

Merged
nashnsulthan merged 6 commits into
productionfrom
dev-server
Jul 22, 2026
Merged

fix: Add validation for interest groups and fix execom roster leaks#3061
nashnsulthan merged 6 commits into
productionfrom
dev-server

Conversation

@DevWithPranav

Copy link
Copy Markdown
Collaborator

No description provided.

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

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces title-based execom detection with explicit role classification and adds interest-group validation. The main changes are:

  • Adds is_execom_role to the role model and IG role creation paths.
  • Filters campus execom rosters using the new role flag.
  • Prevents non-execom role titles from being reused for execom roles.
  • Limits user profile edits to three interest groups.

Confidence Score: 2/5

The role schema and existing-role classification can break the campus execom workflow and need fixes before merging.

  • The unmanaged model field has no matching database schema artifact.
  • Existing execom roles retain the false default and disappear from roster results.
  • New IG role creation paths consistently set the intended classification.

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

Important Files Changed

Filename Overview
db/user.py Adds an unmanaged Role field without the required physical schema change.
api/dashboard/campus/events_views.py Uses the new execom flag for roster filtering and role assignment without backfilling existing roles.
api/dashboard/campus/dash_campus_helper.py Classifies newly created or updated IG campus-lead roles as execom roles.
api/dashboard/ig/dash_ig_view.py Adds execom classification to roles created with an interest group.
api/dashboard/user/dash_user_serializer.py Limits the submitted interest-group list to three entries.

Reviews (1): Last reviewed commit: "Merge pull request #3059 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.

P0 Role Column Missing From Schema

Role is unmanaged, but no matching schema.sql or alter-scripts/ change adds this column. Deployments using the repository schema will make ORM reads and the new execom filter reference a missing column, causing role-backed API requests to fail with a database error.

).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 Legacy Execom Roles Stay Unclassified

The new column defaults to false, and this PR does not backfill existing custom execom or IG campus-lead roles. Once the column exists, members holding those roles disappear from the roster even though the old blacklist included them; the assignment path also rejects their existing role titles as non-execom.

@nashnsulthan
nashnsulthan merged commit 0276120 into production Jul 22, 2026
4 checks passed
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.

3 participants