Refactor and remove tests, update models and views

- Deleted all test files in accounts and twitch apps to clean up the codebase.
- Updated the DropCampaign, Game, Organization, DropBenefit, TimeBasedDrop, and DropBenefitEdge models to include database indexing for improved query performance.
- Modified the DropCampaignListView and GameDetailView to remove unnecessary status filtering and streamline campaign retrieval logic.
- Enhanced the campaign detail template to properly format campaign descriptions.
- Adjusted the import_drop_campaign management command to increase default worker and batch sizes for improved performance.
- Cleaned up the admin configuration for DropCampaign and TimeBasedDrop models.
This commit is contained in:
Joakim Hellsén 2025-07-24 02:40:59 +02:00
commit 8f4e851fb9
16 changed files with 193 additions and 741 deletions

View file

@ -32,10 +32,10 @@ class TimeBasedDropInline(admin.TabularInline):
class DropCampaignAdmin(admin.ModelAdmin):
"""Admin configuration for DropCampaign model."""
list_display = ("id", "name", "game", "owner", "status", "start_at", "end_at", "is_active")
list_filter = ("status", "game", "owner")
list_display = ("id", "name", "game", "owner", "start_at", "end_at", "is_active")
list_filter = ("game", "owner")
search_fields = ("id", "name", "description")
inlines = [TimeBasedDropInline]
inlines = [TimeBasedDropInline] # noqa: RUF012
readonly_fields = ("created_at", "updated_at")
@ -61,7 +61,7 @@ class TimeBasedDropAdmin(admin.ModelAdmin):
)
list_filter = ("campaign__game", "campaign")
search_fields = ("id", "name")
inlines = [DropBenefitEdgeInline]
inlines = [DropBenefitEdgeInline] # noqa: RUF012
@admin.register(DropBenefit)