Skip to content

Commit

Permalink
fix: Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan committed Sep 26, 2023
1 parent 0e3f2d6 commit 1f341fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openedx_learning/core/publishing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def create_publishable_entity_version(
version_num=version_num,
title=title,
created=created,
created_by=created_by,
created_by_id=created_by,
)
Draft.objects.create(
entity_id=entity_id,
Expand Down
5 changes: 3 additions & 2 deletions openedx_tagging/core/tagging/models/system_defined.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist
from django.db import models

from openedx_tagging.core.tagging.models.base import ObjectTag, Tag
Expand Down Expand Up @@ -75,10 +76,10 @@ def get_instance(self) -> models.Model | None:
instance_id = self.tag.external_id if self.tag else None
if instance_id:
try:
return self.tag_class_model.objects.get(pk=instance_id)
return self.tag_class_model.objects.get(pk=instance_id) # type: ignore[attr-defined]
except ValueError as e:
log.exception(f"{self}: {str(e)}")
except self.tag_class_model.DoesNotExist:
except ObjectDoesNotExist:
log.exception(
f"{self}: {self.tag_class_model.__name__} pk={instance_id} does not exist."
)
Expand Down

0 comments on commit 1f341fa

Please sign in to comment.