forked from mirror/django-mailbox
PEP-8 Cleanup.
This commit is contained in:
parent
9f77c9221a
commit
9cdb2d9d1b
10 changed files with 120 additions and 96 deletions
|
|
@ -8,25 +8,30 @@ from django_mailbox.signals import message_received
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_new_mail(mailbox_admin, request, queryset):
|
||||
for mailbox in queryset.all():
|
||||
logger.debug('Receiving mail for %s' % mailbox)
|
||||
mailbox.get_new_mail()
|
||||
get_new_mail.short_description = 'Get new mail'
|
||||
|
||||
|
||||
def resend_message_received_signal(message_admin, request, queryset):
|
||||
for message in queryset.all():
|
||||
logger.debug('Resending \'message_received\' signal for %s' % message)
|
||||
message_received.send(sender=message_admin, message=message)
|
||||
resend_message_received_signal.short_description = 'Re-send message received signal'
|
||||
resend_message_received_signal.short_description = (
|
||||
'Re-send message received signal'
|
||||
)
|
||||
|
||||
|
||||
class MailboxAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
'name',
|
||||
'uri',
|
||||
'from_email',
|
||||
'active',
|
||||
)
|
||||
'name',
|
||||
'uri',
|
||||
'from_email',
|
||||
'active',
|
||||
)
|
||||
actions = [get_new_mail]
|
||||
|
||||
|
||||
|
|
@ -48,23 +53,23 @@ class MessageAdmin(admin.ModelAdmin):
|
|||
MessageAttachmentInline,
|
||||
]
|
||||
list_display = (
|
||||
'subject',
|
||||
'processed',
|
||||
'read',
|
||||
'mailbox',
|
||||
'outgoing',
|
||||
'attachment_count',
|
||||
)
|
||||
'subject',
|
||||
'processed',
|
||||
'read',
|
||||
'mailbox',
|
||||
'outgoing',
|
||||
'attachment_count',
|
||||
)
|
||||
ordering = ['-processed']
|
||||
list_filter = (
|
||||
'mailbox',
|
||||
'outgoing',
|
||||
'processed',
|
||||
'read',
|
||||
)
|
||||
'mailbox',
|
||||
'outgoing',
|
||||
'processed',
|
||||
'read',
|
||||
)
|
||||
raw_id_fields = (
|
||||
'in_reply_to',
|
||||
)
|
||||
'in_reply_to',
|
||||
)
|
||||
exclude = (
|
||||
'body',
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue