learningequality / learningequality/studio

Fix crash in ChannelSerializer.create() without request

Open
#5,783 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug TODO: needs review
Dominant language
Python
Stars
191
Forks
307
Avg merge
5d 6h
Merged PRs (30d)
10

Description

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

Description

create() crashes when no request is passed (e.g. tests/scripts) because it calls user.id when user is None.


Fix
instance.save(actor_id=user.id if user else None)

Why

Prevents crash, matches update(), no impact on normal usage.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ChannelSerializer.create() and compare its handling of the request user with update(), as described in the issue. Verify the no-request path no longer crashes and that normal requests retain their existing behavior; the payload does not name a file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.