Skip to content

fix(problem-statement): admin-created statements attributed to muLearn, not a company - #3263

Merged
DevWithPranav merged 3 commits into
gtech-mulearn:devfrom
afifshowfeer:fix-company-problem-stmt
Oct 10, 2026
Merged

DevWithPranav merged 3 commits into
gtech-mulearn:devfrom
afifshowfeer:fix-company-problem-stmt

Conversation

@afifshowfeer

Copy link
Copy Markdown
Contributor

Admin could previously create a problem statement attributed to any company via company_id. Admin-created statements are now unattached to any company (company nullable, new source field) and are displayed as muLearn everywhere the statement is serialized (admin list, learner feed). Company-created statements are unaffected.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Changes how admin-created problem statements are stored and displayed.

The PR needs the matching database changes before merging.

Findings

  1. P1 Database changes are missing ▶

Summary

Admin-created problem statements now belong to muLearn rather than a company.

  • Admin-created statements belong to muLearn, not a company.
  • MuLearn statements show muLearn in the company field.
  • Searching “mulearn” finds muLearn statements in both lists.

Reviews (2) · Last reviewed commit: "test(problem-statement): replace admin-c..." · Reviewed by Greptile

Comment thread db/problem_statement.py
skills = models.JSONField(default=list)
deadline = models.DateTimeField(null=True, blank=True)
status = models.CharField(max_length=20, choices=Status.choices, default=Status.DRAFT)
source = models.CharField(max_length=20, choices=Source.choices, default=Source.COMPANY)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Database changes are missing

ProblemStatement now requires source and allows a null company, but schema.sql has no source column and still requires company_id. With managed = False, Django will not change this table. If the database matches the checked-in schema, statement reads and writes fail with an unknown-column error. Admin creation also needs nullable company_id.

The repository rules require matching schema artifacts. Update schema.sql and add an upgrade script that supplies a default or backfill for existing rows.

Comment thread api/dashboard/problem_statement/manage_views.py
Comment thread api/dashboard/problem_statement/serializers.py
@DevWithPranav
DevWithPranav merged commit 86d6156 into gtech-mulearn:dev Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

3 participants