Skip to content

Commit

Permalink
admin tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanHayes committed Apr 27, 2011
1 parent a5ee240 commit 3586082
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django_email_test/__init__.py
@@ -1,3 +1,3 @@
VERSION = (0, 0, 1)
VERSION = (0, 0, 2)

__version__ = "".join([".".join(map(str, VERSION[0:3])), "".join(VERSION[3:])])
11 changes: 10 additions & 1 deletion django_email_test/admin.py
Expand Up @@ -16,6 +16,15 @@ class TestEmailAdmin(admin.ModelAdmin):
list_filter = ['sent']
readonly_fields = ['added', 'sent', 'error']
save_as = True
search_fields = ['subject', 'from_email', 'to', 'bcc', 'body']
search_fields = ['subject', 'from_email', 'to', 'bcc', 'body', 'error']

def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'to':
request = kwargs.get('request', None)

if request is not None:
db_field.default = request.user.email

return super(TestEmailAdmin, self).formfield_for_dbfield(db_field, **kwargs)

admin.site.register(TestEmail, TestEmailAdmin)

0 comments on commit 3586082

Please sign in to comment.