fix: added type annotations to fix mypy failure in CI (#28933)

This commit is contained in:
Aarif
2021-10-05 17:04:11 +05:00
committed by GitHub
parent 81bf0f75c9
commit 7d2cc016ec
2 changed files with 13 additions and 4 deletions

View File

@@ -6,12 +6,18 @@ persist the assignments.
import logging
from django.conf import settings
from typing import Dict
from django.conf import settings
from django.contrib.auth import get_user_model
from openedx.core.lib.cache_utils import request_cached
from openedx.core.lib.dynamic_partitions_generators import DynamicPartitionGeneratorsPluginManager
from xmodule.modulestore.django import modulestore
from xmodule.partitions.partitions import get_partition_from_id
from .partitions import Group
User = get_user_model()
log = logging.getLogger(__name__)
@@ -38,7 +44,8 @@ def get_all_partitions_for_course(course, active_only=False):
return all_partitions
def get_user_partition_groups(course_key, user_partitions, user, partition_dict_key='name'):
def get_user_partition_groups(course_key: str, user_partitions: list, user: User,
partition_dict_key: str = 'name') -> Dict[str, Group]:
"""
Collect group ID for each partition in this course for this user.
Arguments: