lazy ass fix for feelings not working.

This commit is contained in:
some weird guy
2023-10-18 14:39:51 -07:00
parent e5c99e0248
commit bb7e453ed4
2 changed files with 5 additions and 5 deletions
-5
View File
@@ -57,7 +57,6 @@ class message_form(forms.ModelForm):
fields = ( fields = (
'body', 'body',
'file', 'file',
'feeling_id',
) )
class comment_form(forms.ModelForm): class comment_form(forms.ModelForm):
@@ -81,8 +80,6 @@ class comment_form(forms.ModelForm):
fields = ( fields = (
'body', 'body',
'file', 'file',
'feeling_id',
'is_spoiler',
) )
class post_form(forms.ModelForm): class post_form(forms.ModelForm):
@@ -117,8 +114,6 @@ class post_form(forms.ModelForm):
'body', 'body',
'url', 'url',
'file', 'file',
'feeling_id',
'is_spoiler',
) )
class edit_community(forms.ModelForm): class edit_community(forms.ModelForm):
+5
View File
@@ -924,6 +924,8 @@ def post_create(request, community):
new_post = form.save(commit=False) new_post = form.save(commit=False)
new_post.creator = request.user new_post.creator = request.user
new_post.community = community new_post.community = community
new_post.feeling = form.cleaned_data.get('feeling_id')
new_post.spoils = form.cleaned_data.get('is_spoiler')
new_post.save() new_post.save()
else: else:
return json_response(form.errors.as_text()) return json_response(form.errors.as_text())
@@ -1065,6 +1067,8 @@ def post_comments(request, post):
new_comment.creator = request.user new_comment.creator = request.user
new_comment.community = post.community new_comment.community = post.community
new_comment.original_post = post new_comment.original_post = post
new_comment.feeling = form.cleaned_data.get('feeling_id')
new_comment.spoils = form.cleaned_data.get('is_spoiler')
new_comment.save() new_comment.save()
else: else:
return json_response(form.errors.as_text()) return json_response(form.errors.as_text())
@@ -1398,6 +1402,7 @@ def messages_view(request, username):
new_message = form.save(commit=False) new_message = form.save(commit=False)
new_message.creator = request.user new_message.creator = request.user
new_message.conversation = conversation new_message.conversation = conversation
new_message.feeling = form.cleaned_data.get('feeling_id')
new_message.save() new_message.save()
else: else:
return json_response(form.errors.as_text()) return json_response(form.errors.as_text())