Skip to content

Implement soft-delete for task_list and enhance campus member visibility#3075

Open
DevWithPranav wants to merge 32 commits into
productionfrom
feat/patch-v1
Open

Implement soft-delete for task_list and enhance campus member visibility#3075
DevWithPranav wants to merge 32 commits into
productionfrom
feat/patch-v1

Conversation

@DevWithPranav

Copy link
Copy Markdown
Collaborator

No description provided.

DevWithPranav and others added 30 commits July 21, 2026 22:31
feat(dashboard): add soft-delete fields and ignore deleted tasks in hashtag validation
feat: Implement soft-delete for task_list and update campus member visibility
Fixed the custom roles not listing issue
fix:company admin can directly appoint a mentor
fix: Fix custom roles listing and mentor appointment issues
fix(task): remove active filter from TaskListAPI queryset
fix: Remove active filter from TaskListAPI queryset
Added api for mentor company change and established mentor linkedin submission and admin approval request
Implement mentor company change API and fix various issues
Update IG count calculation and add karma breakdown to profiles
Update IG count calculation and add karma breakdown to profiles
…configuration

- Added a new cron task to update alumni status based on graduation year.
- Modified celery configuration to include the new task module.
- Refactored various serializers and views for improved functionality and clarity.
- Enhanced task models to support soft-delete functionality.
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds task soft deletion and expands campus and mentor workflows. The main changes are:

  • Separate task deletion state, actor, and timestamp fields.
  • Company mentor auto-approval and scope assignment.
  • LinkedIn verification and company-change requests for mentors.
  • Campus, learning-circle, and profile aggregation updates.
  • Scheduled alumni-status reconciliation.

Confidence Score: 4/5

The task schema and visibility paths need fixes before merging.

  • Production databases can reject the new unmanaged model columns when the external DDL is absent.
  • The global task list can return deleted and inactive tasks.
  • Blank LinkedIn updates report success without clearing the stored URL.

db/task.py, api/dashboard/task/dash_task_view.py, api/dashboard/mentor/mentor_views.py

Important Files Changed

Filename Overview
db/task.py Adds soft-delete columns and an index to an unmanaged model without external DDL.
api/dashboard/company/task_views.py Records task deletion state, actor, and timestamp and hides deleted company tasks.
api/dashboard/task/dash_task_view.py Removes the active-task restriction without adding the new deletion restriction.
api/dashboard/mentor/mentor_views.py Adds LinkedIn verification and company-change flows, but silently ignores blank LinkedIn updates.
api/dashboard/mentor/serializers.py Adds LinkedIn validation and approval handling through temporary mentor records.
api/dashboard/company/serializers.py Atomically creates approved company mentors, role links, scope grants, and organization links.
api/dashboard/profile/profile_serializer.py Adds categorized karma totals and event and interest-group breakdowns.
mu_celery/alumni_cron.py Adds scheduled reconciliation of alumni status from graduation years.

Reviews (1): Last reviewed commit: "feat: implement alumni status synchroniz..." | Re-trigger Greptile

Comment thread db/task.py
Comment on lines +179 to +186
# Soft-delete tracking, distinct from `active` (which is used for the
# pending-approval workflow and admin activation/deactivation toggle).
is_deleted = models.BooleanField(default=False)
deleted_at = models.DateTimeField(null=True, blank=True)
deleted_by = models.ForeignKey(
User, on_delete=models.SET_NULL, null=True, blank=True,
db_column='deleted_by', related_name='task_list_deleted_by'
)

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 Soft-Delete Columns Missing From Schema

TaskList is unmanaged, but this PR has no matching schema.sql or alter-scripts/ update for these columns. On a database without the external DDL, the new list filters fail with Unknown column 'task_list.is_deleted', and deletion fails when writing deleted_at or deleted_by.

Comment on lines 282 to +285
"skill_links__skill"
).annotate(
total_karma_gainers_count=Count("karma_activity_log_task", filter=Q(karma_activity_log_task__appraiser_approved=True))
).filter(active=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 Deleted Tasks Remain Globally Visible

The company delete path now sets only is_deleted=True, while this queryset no longer filters either active or is_deleted. A deleted task therefore remains visible in the global task list, and inactive pending or deactivated tasks that were previously hidden are exposed as well.

Comment on lines 246 to +254
if serializer.is_valid():
linkedin_url = serializer.validated_data.get('linkedin')

if linkedin_url:
# Create a verification request instead of updating directly
if UserMentor.objects.filter(user_id=user_id, status=UserMentor.Status.PENDING, about="[LinkedIn URL Update Request]").exists():
return CustomResponse(general_message="You already have a pending LinkedIn URL update request.").get_failure_response()

# Save other profile fields. The serializer's update method will pop 'linkedin'.

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 Blank LinkedIn Update Is Discarded

linkedin allows blank input, but this truthiness check handles only non-empty values and the serializer later removes the field before saving. When a mentor submits an empty string to clear an existing URL, the endpoint reports success while leaving the old URL unchanged.

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.

4 participants