Skip to content

Commit

Permalink
adding email field to registration inline form in admin. closes #76
Browse files Browse the repository at this point in the history
  • Loading branch information
orzubalsky committed Feb 1, 2014
1 parent 75d33ac commit d2b6218
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ts/apps/tradeschool/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,27 @@ def registration_link(self, obj):
)
registration_link.short_description = _('Title')

def student_email_link(self, obj):
"""
Return an anchor tag with the registered student's email.
"""
# return a safe output so the html can be rendered in the template
return mark_safe(
'<a target="_blank" href="mailto:%s">%s</a>' % (
obj.student.email, obj.student.email)
)
student_email_link.short_description = _('Email')

model = Registration
readonly_fields = (
'registration_link',
'student_email_link',
'items',
'registration_status'
)
fields = (
'registration_link',
'student_email_link',
'items',
'registration_status',
)
Expand Down

0 comments on commit d2b6218

Please sign in to comment.