Calling `cast()` after `master` does not return "Detail" model
Open
Nobody has claimed this yet.
Issue
- Dominant language
- Python
- Stars
- 598
- Forks
- 168
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 86
Description
Version
main branch
Describe the bug
Calling cast() after master returns "Master" model instead of "Detail" model. This is probably not a big deal, since it is not expected that anyone will use such code.
To Reproduce
repo = FileRepository.objects.create(name=str(uuid4()))
repo.master
<Repository (pulp_type=core.repository): pk=01960127-92e3-729e-a68b-d81602c0d198>
repo.master.cast()
<Repository (pulp_type=core.repository): pk=01960127-92e3-729e-a68b-d81602c0d198>
Expected behavior
repo.master.cast()
<FileRepository (pulp_type=file.file): pk=01960127-92e3-729e-a68b-d81602c0d198>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the FileRepository, master, and cast() calls shown in the report. Trace how master and cast() determine the returned model; done means repo.master.cast() returns a FileRepository rather than a Repository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100