Fix undefined author variable
This commit is contained in:
parent
e935911bd5
commit
3d6afc6625
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user