Implement team join request functionality with views and actions
- Added join_requests.html template for displaying pending join requests. - Created join_team.html template for users to submit join requests. - Implemented request_processed.html template to show the result of join request processing. - Developed authentication utilities for user session management. - Introduced convenience redirects for common URL patterns. - Established team management routes and actions for creating, editing, and joining teams. - Added functionality for approving and denying join requests with email notifications. - Enhanced team views to include user permissions and team member details. - Implemented utility functions for team-related operations such as calculating total points and team rank.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
Router for convenience redirects to simplify common URL patterns.
|
||||
"""
|
||||
from fastapi import APIRouter
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
router = APIRouter(tags=["Convenience"])
|
||||
|
||||
@router.get("/scan")
|
||||
async def scan_redirect():
|
||||
"""Redirect /scan to /dashboard/scan"""
|
||||
return RedirectResponse("/dashboard/scan", status_code=303)
|
||||
|
||||
@router.get("/login")
|
||||
async def login_redirect():
|
||||
"""Redirect /login to /auth/login"""
|
||||
return RedirectResponse("/auth/login", status_code=303)
|
||||
|
||||
@router.get("/register")
|
||||
async def register_redirect():
|
||||
"""Redirect /register to /auth/register"""
|
||||
return RedirectResponse("/auth/register", status_code=303)
|
||||
|
||||
@router.get("/profile")
|
||||
async def profile_redirect():
|
||||
"""Redirect /profile to /auth/profile"""
|
||||
return RedirectResponse("/auth/profile", status_code=303)
|
||||
|
||||
@router.get("/logout")
|
||||
async def logout_redirect():
|
||||
"""Redirect /logout to /auth/logout"""
|
||||
return RedirectResponse("/auth/logout", status_code=303)
|
||||
Reference in New Issue
Block a user