Skip to content

Commit

Permalink
fix: typing added
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithEmad committed Nov 18, 2023
1 parent e9d686a commit 689abab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tutorandroid/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import pkg_resources

from tutor import hooks as tutor_hooks
from tutor.types import Config, get_typed

from .__about__ import __version__

config = {
"unique": {"OAUTH2_SECRET": "{{ 24|random_string }}"},
config: t.Dict[str, t.Dict[str, t.Any]] = {
"defaults": {
"VERSION": __version__,
"APP_HOST": "mobile.{{ LMS_HOST }}",
Expand Down Expand Up @@ -63,7 +63,9 @@

@tutor_hooks.Filters.IMAGES_PULL.add()
@tutor_hooks.Filters.IMAGES_PUSH.add()
def _add_remote_android_app_image_iff_customized(images, user_config):
def _add_remote_android_app_image_iff_customized(
images: list[tuple[str, str]], user_config: Config
) -> list[tuple[str, str]]:
"""
Register ANDROID-APP image for pushing & pulling if and only if it has
been set to something other than the default.
Expand All @@ -75,7 +77,7 @@ def _add_remote_android_app_image_iff_customized(images, user_config):
to push/pull the ANDROID-APP image if the user has customized it to anything
other than the default image URL.
"""
image_tag = user_config["ANDROID_APP_DOCKER_IMAGE"]
image_tag = get_typed(user_config, "ANDROID_APP_DOCKER_IMAGE", str, "")
if not image_tag.startswith("docker.io/overhangio/openedx-android-app:"):
# Image has been customized. Add to list for pulling/pushing.
images.append(("android-app", image_tag))
Expand Down

0 comments on commit 689abab

Please sign in to comment.