Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

Implements two feed enhancements: (1) superadmin ability to delete activities, (2) RSS feed subscription for activity updates.

Changes

Backend

  • website/views/organization.py: Added delete_activity view with @login_required, @require_POST, and superuser authorization check. Returns 403 for non-superusers.
  • website/feeds.py: New ActivityFeed class extending Django's Feed. Provides RSS 2.0 feed with latest 50 activities including title, description, author, and timestamp.
  • blt/urls.py: Added endpoints:
    • POST /activity/delete/<id>/ for deletion
    • GET /feed/rss/ for RSS feed

Frontend

  • website/templates/feed.html:
    • Orange RSS button with icon at page top
    • Gray delete button visible only to request.user.is_superuser
    • deleteActivity() JavaScript with confirmation dialog

Security

  • Multi-layer authorization: login + POST-only + superuser check
  • CSRF protection on POST requests
  • Confirmation dialog prevents accidental deletions

Tests

  • website/test_feed.py: 9 tests covering feed access, authorization checks, delete execution, RSS generation, and UI element visibility

UI Changes

Activity Feed UI Changes

Top: RSS subscription button (orange, standard RSS color)
Bottom: Delete button for superadmins (gray, with confirmation)

Example Usage

Delete an activity (superadmin only):

// Confirmation dialog shown first
deleteActivity(activityId);
// → POST /activity/delete/{id}/
// → Returns: {"success": true, "message": "Activity deleted successfully"}

Subscribe to feed:

curl https://example.com/feed/rss/
# Returns RSS 2.0 XML with latest 50 activities

Files Changed

blt/urls.py                   |   4 +
website/feeds.py              |  51 ++++++
website/templates/feed.html   |  40 +++++
website/test_feed.py          | 128 ++++++++++++++
website/views/organization.py |  13 ++
Original prompt

allow superadmins to delete activity from the feed also add an rss feed that users can subscribe to - show information on that with an rss icon on the /feed/ page


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 1, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Allow superadmins to delete activity from the feed and add RSS feed Add superadmin delete for activity feed and RSS subscription Nov 1, 2025
Copilot AI requested a review from DonnieBLT November 1, 2025 20:19
@DonnieBLT DonnieBLT marked this pull request as ready for review November 1, 2025 20:37
@DonnieBLT DonnieBLT merged commit 6ce28d6 into main Nov 16, 2025
14 of 20 checks passed
@DonnieBLT DonnieBLT deleted the copilot/allow-superadmins-delete-activity branch November 16, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants