Implement soft-delete for task_list and enhance campus member visibility#3075
Implement soft-delete for task_list and enhance campus member visibility#3075DevWithPranav wants to merge 32 commits into
Conversation
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
…ubmission and admin approval request
Added api for mentor company change and established mentor linkedin submission and admin approval request
Implement mentor company change API and fix various issues
… UserProfileSerializer
…a breakdown calculations
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 SummaryThis PR adds task soft deletion and expands campus and mentor workflows. The main changes are:
|
| 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
| # 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' | ||
| ) |
There was a problem hiding this comment.
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.
| "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) | ||
| ) |
There was a problem hiding this comment.
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.
| 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'. |
There was a problem hiding this comment.
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.
No description provided.