Skip to content

Commit

Permalink
Merge pull request #266 from djangoindia/test_user_account
Browse files Browse the repository at this point in the history
Fix swappable dependency problem
  • Loading branch information
DevilsAutumn authored Jan 9, 2025
2 parents d5fc3fc + 12bc98b commit 418e2b5
Show file tree
Hide file tree
Showing 5 changed files with 876 additions and 9 deletions.
10 changes: 3 additions & 7 deletions backend/djangoindia/db/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,11 @@ class SponsorAdmin(admin.ModelAdmin):
@admin.register(Update)
class UpdateAdmin(admin.ModelAdmin):
form = UpdateForm
list_display = ("email_subject", "type", "created_by", "created_at", "mail_sent")
search_fields = ["email_subject", "created_by__username", "created_by__first_name", "type"]
readonly_fields = ("created_by", "created_at", "updated_at")
list_display = ("email_subject", "type", "created_at", "mail_sent")
search_fields = ["email_subject", "type"]
readonly_fields = ("created_at", "updated_at")
actions = ["send_update"]

def save_model(self, request, obj, form, change):
obj.created_by = request.user
super().save_model(request, obj, form, change)

@admin.action(description="Send selected updates to subscribers")
def send_update(self, request, queryset):
for update in queryset:
Expand Down
Loading

0 comments on commit 418e2b5

Please sign in to comment.