Skip to content

ESoCC: Create migration command to populate distributable AuditedSpecialPermissionsLicense for public channels #5626

@AlexVelezLl

Description

@AlexVelezLl

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

The AuditedSpecialPermissionsLicense model stores the description of special permissions to ensure that they can be distributed in our public libraries. Since public channels already hold nodes with special permissions, they need to be declared as distributable in our system.

Technical details

  • Create a new command on contentcuration/contentcuration/management/commands/set_distributable_special_permissions.py.
  • Query all kolibri_public.models.ContentNode whose license_name is licenses.SPECIAL_PERMISSIONS.
  • Extract their license_description field using .distinct() to get uniques descriptions, exclude empty descriptions.
  • Create new AuditedSpecialPermissionsLicense objects with all these descriptions, setting distributable=True, and then call AuditedSpecialPermissionsLicense.objects.bulk_create to bulk insert all these objects in the database. Similar to this.

Acceptance criteria

  • A new set_distributable_special_permissions command is created.
  • After running this command, all special license descriptions of public ContentNodes are stored in the AuditedSpecialPermissionsLicense model with distributable=True.
  • Unit tests have been added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0 - criticalPriority: Release blocker or regression

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions