mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-21 23:43:11 +01:00
Enhancements to Admin (#524)
* Add columns to the IgnoreEmail admin page including a calculated column of the queues the ignore relates to. * Add columns to the IgnoreEmail admin page including a calculated column of the queues the ignore relates to. * Revert "Merge pull request #519 from mrkiwi-nz/master" This reverts commit410f59ad16
, reversing changes made tofde06d3ab1
. * Add columns to the IgnoreEmail admin page including a calculated column of the queues the ignore relates to. * Merge pull request #519 from mrkiwi-nz/master Added some helpful columns and filters to the follow-up list page. * Add more columns to the IgnoreEmail admin page including a calculated column of the queues the ignore relates to.
This commit is contained in:
parent
410f59ad16
commit
ef0ba19a3b
@ -65,7 +65,11 @@ class EmailTemplateAdmin(admin.ModelAdmin):
|
||||
list_filter = ('locale', )
|
||||
|
||||
|
||||
@admin.register(IgnoreEmail)
|
||||
class IgnoreEmailAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'queue_list', 'email_address', 'keep_in_mailbox')
|
||||
|
||||
|
||||
admin.site.register(PreSetReply)
|
||||
admin.site.register(EscalationExclusion)
|
||||
admin.site.register(KBCategory)
|
||||
admin.site.register(IgnoreEmail)
|
||||
|
@ -1199,6 +1199,16 @@ class IgnoreEmail(models.Model):
|
||||
self.date = timezone.now()
|
||||
return super(IgnoreEmail, self).save(*args, **kwargs)
|
||||
|
||||
def queue_list(self):
|
||||
"""Return a list of the queues this IgnoreEmail applies to.
|
||||
If this IgnoreEmail applies to ALL queues, return '*'.
|
||||
"""
|
||||
queues = self.queues.all().order_by('title')
|
||||
if len(queues) == 0:
|
||||
return '*'
|
||||
else:
|
||||
return ', '.join([str(q) for q in queues])
|
||||
|
||||
def test(self, email):
|
||||
"""
|
||||
Possible situations:
|
||||
|
Loading…
Reference in New Issue
Block a user