Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports fix for export breakage from develop #8425

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kolibri/core/content/management/commands/scanforcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def database_file_is_newer(self, channel_id, disk_path):
disk_channel = read_channel_metadata_from_db_file(disk_path)
db_channel = ChannelMetadata.objects.get(id=channel_id)
# the version in the primary database is older than the one on disk
return disk_channel.version > db_channel.version
return disk_channel["version"] > db_channel.version
except DatabaseError:
# problem with the database on disk; it can't be considered newer
return False
Expand Down
22 changes: 11 additions & 11 deletions kolibri/core/content/utils/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ def get_channels_for_data_folder(datafolder):
continue
channel_data = {
"path": path,
"id": channel.id,
"name": channel.name,
"description": channel.description,
"tagline": getattr(channel, "tagline", ""),
"thumbnail": channel.thumbnail,
"version": channel.version,
"root": channel.root_id,
"author": channel.author,
"last_updated": getattr(channel, "last_updated", None),
"lang_code": getattr(channel, "lang_code", None),
"lang_name": getattr(channel, "lang_name", None),
"id": channel["id"],
"name": channel["name"],
"description": channel["description"],
"tagline": channel.get("tagline", ""),
"thumbnail": channel["thumbnail"],
"version": channel["version"],
"root": channel["root_id"],
"author": channel["author"],
"last_updated": channel.get("last_updated"),
"lang_code": channel.get("lang_code"),
"lang_name": channel.get("lang_name"),
}
channels.append(channel_data)
return channels
Expand Down
2 changes: 1 addition & 1 deletion kolibri/core/tasks/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def channeldiffstats(self, request):
channel_metadata = read_channel_metadata_from_db_file(
get_content_database_file_path(channel_id, drive.datafolder)
)
job_metadata["new_channel_version"] = channel_metadata.version
job_metadata["new_channel_version"] = channel_metadata["version"]
else:
raise serializers.ValidationError(
"'method' field should either be 'network' or 'disk'."
Expand Down