Remove unused files and enhance error handling in serializers.py
- Deleted the outdated backend dependency file for drf-spectacular. - Removed an unused image from the frontend assets. - Improved error handling in TasksSerializer by catching ObjectDoesNotExist in addition to AttributeError.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from rest_framework import serializers
|
||||
from django.db import models
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from .models import Tasks, Images, Content
|
||||
from igny8_core.business.planning.models import Clusters, ContentIdeas
|
||||
|
||||
@@ -85,7 +86,7 @@ class TasksSerializer(serializers.ModelSerializer):
|
||||
def _get_content_record(self, obj):
|
||||
try:
|
||||
return obj.content_record
|
||||
except AttributeError:
|
||||
except (AttributeError, ObjectDoesNotExist):
|
||||
return None
|
||||
|
||||
def get_content_html(self, obj):
|
||||
|
||||
Reference in New Issue
Block a user