Add notification settings and forms for email notifications
This commit is contained in:
parent
93f5f05a33
commit
bb8949af76
19 changed files with 435 additions and 23 deletions
|
@ -5,10 +5,24 @@ from .models import Emailadress, BirdEmail
|
|||
|
||||
@admin.register(Emailadress)
|
||||
class EmailaddressAdmin(admin.ModelAdmin):
|
||||
list_display = ["email_address", "created_at", "updated_at", "user"]
|
||||
list_display = ["email_address", "is_naturschutzbehoerde", "is_jagdbehoerde", "is_wildvogelhilfe_team", "created_at", "updated_at", "user"]
|
||||
search_fields = ["email_address"]
|
||||
list_filter = ["created_at", "updated_at", "user"]
|
||||
list_filter = ["is_naturschutzbehoerde", "is_jagdbehoerde", "is_wildvogelhilfe_team", "created_at", "updated_at", "user"]
|
||||
list_per_page = 20
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields': ('email_address',)
|
||||
}),
|
||||
('Notification Categories', {
|
||||
'fields': ('is_naturschutzbehoerde', 'is_jagdbehoerde', 'is_wildvogelhilfe_team'),
|
||||
'description': 'Select which types of notifications this email address should receive'
|
||||
}),
|
||||
)
|
||||
|
||||
def save_model(self, request, obj, form, change):
|
||||
if not change: # Only set user when creating new object
|
||||
obj.user = request.user
|
||||
super().save_model(request, obj, form, change)
|
||||
|
||||
|
||||
@admin.register(BirdEmail)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue