Fix undefined author variable

This commit is contained in:
Nathan Chapman 2022-07-22 13:09:16 -06:00
parent e935911bd5
commit 3d6afc6625

View File

@ -85,8 +85,8 @@ class PostCreateForm(forms.ModelForm):
def send_notification(self, request, post): def send_notification(self, request, post):
recipients = list(post.recipients.values_list('email', flat=True)) recipients = list(post.recipients.values_list('email', flat=True))
url = get_current_site(request).domain + post.get_absolute_url() url = get_current_site(request).domain + post.get_absolute_url()
if author.email in recipients: if post.author.email in recipients:
recipients.remove(author.email) recipients.remove(post.author.email)
context = { context = {
'subject': post.title, 'subject': post.title,