Skip to content

Commit

Permalink
chore: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Oct 3, 2023
1 parent 502bb21 commit 3fba862
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 9 deletions.
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/content_tagging/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from __future__ import annotations

from typing import Iterator, List, Type
from typing import Iterator

import openedx_tagging.core.tagging.api as oel_tagging
from django.db.models import Q, QuerySet, Exists, OuterRef
Expand Down Expand Up @@ -38,7 +38,7 @@ def create_taxonomy(
def set_taxonomy_orgs(
taxonomy: Taxonomy,
all_orgs=False,
orgs: List[Organization] = None,
orgs: list[Organization] = None,
relationship: TaxonomyOrg.RelType = TaxonomyOrg.RelType.OWNER,
):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.2.21 on 2023-09-29 23:32

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('content_tagging', '0005_auto_20230830_1517'),
]

operations = [
migrations.DeleteModel(
name='ContentAuthorTaxonomy',
),
migrations.DeleteModel(
name='ContentLanguageTaxonomy',
),
migrations.DeleteModel(
name='ContentTaxonomy',
),
]
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/content_tagging/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Exists, OuterRef, Q, QuerySet
from django.db.models import Q, QuerySet
from django.utils.translation import gettext as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import LearningContextKey, UsageKey
Expand Down Expand Up @@ -108,5 +108,5 @@ def clean(self):
# Make sure that object_id is a valid key
try:
self.object_key
except InvalidKeyError:
raise ValidationError("object_id is not a valid opaque key string.")
except InvalidKeyError as err:
raise ValidationError("object_id is not a valid opaque key string.") from err
1 change: 0 additions & 1 deletion openedx/core/djangoapps/content_tagging/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def update_course_tags(course_key_str: str) -> bool:
return True
except Exception as e: # pylint: disable=broad-except
log.error("Error updating tags for Course with id: %s. %s", course_key, e)
raise e
return False


Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content_tagging/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import ddt
from django.test.testcases import TestCase
from opaque_keys.edx.keys import CourseKey, UsageKey
from openedx_tagging.core.tagging.models import ObjectTag, Tag
from openedx_tagging.core.tagging.models import Tag
from organizations.models import Organization

from .. import api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ddt
from django.contrib.auth import get_user_model
from django.test.testcases import TestCase, override_settings
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from openedx_tagging.core.tagging.models import (
Tag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.core.management import call_command
from django.test import override_settings
from edx_toggles.toggles.testutils import override_waffle_flag
from openedx_tagging.core.tagging.models import LanguageTaxonomy, ObjectTag, Tag, Taxonomy
from openedx_tagging.core.tagging.models import LanguageTaxonomy, Tag, Taxonomy
from organizations.models import Organization

from common.djangoapps.student.tests.factories import UserFactory
Expand Down

0 comments on commit 3fba862

Please sign in to comment.