Skip to content

Save channel included categories and expose channel version history#5176

Merged
AlexVelezLl merged 3 commits intolearningequality:community-channelsfrom
Jakoma02:get_published_data
Jul 17, 2025
Merged

Save channel included categories and expose channel version history#5176
AlexVelezLl merged 3 commits intolearningequality:community-channelsfrom
Jakoma02:get_published_data

Conversation

@Jakoma02
Copy link
Contributor

@Jakoma02 Jakoma02 commented Jul 12, 2025

Summary

This PR includes the list of included categories and licenses in the Channel published_data field and adds a get_published_data channel action to query the published data.

Detailed changes:

  • The fill_published_fields method was modified to include the included_licenses and included_categories fields in published_data on channel publish
  • The get_published_data action was added to ChannelViewSet
  • Tests were added to verify the functionality

No manual testing other than designing the tests and checking that they pass was done.

References

Closes #5169.

Reviewer guidance

The get_published_data is available for users with edit permissions for the given channel, it should be checked that this matches the expectation.

@AlexVelezLl AlexVelezLl linked an issue Jul 16, 2025 that may be closed by this pull request
3 tasks
Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Code changes makes sense, unit tests give confidence on the changes, and manual QA passes. Just found a potentially unintentional change, after we revert this change, we can proceed with the merge :).

def channel_language_exists(
self, request, pk=None
) -> Union[JsonResponse, HttpResponse]:
def channel_language_exists(self, request, pk=None) -> JsonResponse:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there any motivation to change this line? Seems like an unintentional change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, this was not intentional... this change was suggested to me by Copilot code review, I did not realize it was suggesting changes for a line I haven't even touched. Also, I remember checking that HttpResponse is indeed not returned from the function, I must have been blind 🙈 On the other hand, I in fact had the types wrong in the function I did write, and Copilot did not catch that 🤷 It definitely seems I need to be more careful with this in the future, thanks for catching this! Fixed in 73b72be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe Copilot was right and discovered the actual mistake, and I just messed up when fixing it... I'm not 100% sure right now

Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jakoma02! LGTM!

@AlexVelezLl AlexVelezLl merged commit dc2eb2c into learningequality:community-channels Jul 17, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESoCC: Save channel included categories and expose channel version history

2 participants