-
Notifications
You must be signed in to change notification settings - Fork 13
Q&A Feature #1249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Q&A Feature #1249
Changes from all commits
9c1a60c
b54f8c3
1696b44
02ac760
05b0bf4
53d19d6
4c5e2b2
561d90e
697208f
3f07ee5
b647180
6501ce8
e632963
1cdb6c4
035baa5
b638d4c
cc14261
c937751
6459da6
20ea4ca
a54539d
6749de5
1d35d31
da80810
e39f8b9
2c1c566
4928ccf
92eae97
9a1fb5b
4fc9d1d
809b5a0
3f5c824
1f517b3
929984a
3dd0385
2361617
faedfcb
da84bdf
be2ffdd
ca34387
fd210de
85075cc
454e4c7
a0b9495
c92ad2e
a33490e
25297e5
65a3777
5e0d56e
7e9d1f7
5d82d72
60ba667
3d5894b
f7eeb77
dcd2d4f
d34b906
9f30179
6b2eaa4
6276c12
b8a44e3
32eb53a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Generated by Django 4.2.28 on 2026-02-04 05:13 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("tcf_website", "0023_remove_sectionenrollment_section_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="question", | ||
| name="title", | ||
| field=models.CharField(blank=True, max_length=200), | ||
| ), | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Generated manually | ||
|
|
||
| import django.db.models.deletion | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("tcf_website", "0024_question_title"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name="question", | ||
| name="instructor", | ||
| field=models.ForeignKey( | ||
| blank=True, | ||
| default=None, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| to="tcf_website.instructor", | ||
| ), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Generated by Django 4.2.28 on 2026-03-04 00:02 | ||
|
|
||
| from django.db import migrations, models | ||
| import django.db.models.deletion | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("tcf_website", "0025_question_instructor_optional"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="answer", | ||
| name="parent_answer", | ||
| field=models.ForeignKey( | ||
| blank=True, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| related_name="replies", | ||
| to="tcf_website.answer", | ||
| ), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Generated by Django 4.2.28 on 2026-03-04 00:11 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("tcf_website", "0026_answer_parent_answer"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RemoveConstraint( | ||
| model_name="answer", | ||
| name="unique answer per user and question", | ||
| ), | ||
| migrations.AddConstraint( | ||
| model_name="answer", | ||
| constraint=models.UniqueConstraint( | ||
| condition=models.Q(("parent_answer__isnull", True)), | ||
| fields=("user", "question"), | ||
| name="unique answer per user and question", | ||
| ), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Generated manually | ||
|
|
||
| from django.db import migrations, models | ||
| import django.db.models.deletion | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("tcf_website", "0027_remove_answer_unique_answer_per_user_and_question_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="question", | ||
| name="department", | ||
| field=models.ForeignKey( | ||
| blank=True, | ||
| default=None, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| to="tcf_website.department", | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="question", | ||
| name="course", | ||
| field=models.ForeignKey( | ||
| blank=True, | ||
| default=None, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| to="tcf_website.course", | ||
| ), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| from django.db import migrations, models | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| class Migration(migrations.Migration): | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| dependencies = [ | ||||||||||||||||||||||||||||||||||||||||||||||
| ("tcf_website", "0028_question_department_and_optional_course"), | ||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| operations = [ | ||||||||||||||||||||||||||||||||||||||||||||||
| migrations.AlterField( | ||||||||||||||||||||||||||||||||||||||||||||||
| model_name="answer", | ||||||||||||||||||||||||||||||||||||||||||||||
| name="semester", | ||||||||||||||||||||||||||||||||||||||||||||||
| field=models.ForeignKey( | ||||||||||||||||||||||||||||||||||||||||||||||
| blank=True, | ||||||||||||||||||||||||||||||||||||||||||||||
| default=None, | ||||||||||||||||||||||||||||||||||||||||||||||
| null=True, | ||||||||||||||||||||||||||||||||||||||||||||||
| on_delete=models.SET_NULL, | ||||||||||||||||||||||||||||||||||||||||||||||
| to="tcf_website.semester", | ||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Django docs explicitly show Fix both this migration and the field definition in 🛡️ Proposed fix- on_delete=django.db.models.deletion.CASCADE,
+ on_delete=django.db.models.deletion.SET_NULL,Update 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Generated by Django 4.2.28 on 2026-05-01 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("tcf_website", "0029_alter_answer_semester"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RemoveConstraint( | ||
| model_name="answer", | ||
| name="unique answer per user and question", | ||
| ), | ||
| ] |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration filename doesn't match its operations.
The filename
0024_forumcategory_forumpost_forumresponse_question_title_and_more.pyimplies newForumCategory,ForumPost, andForumResponsemodels plus aQuestion.titlefield, but the file only contains a singleAddFieldforQuestion.title. This suggests either leftover scaffolding from an abandoned approach or a partially-squashed migration. Renaming to something like0024_question_title.pywould prevent future confusion (rename only if the migration hasn't been applied to any deployed environment yet — otherwise leave it).🧰 Tools
🪛 Ruff (0.15.11)
[warning] 8-10: Mutable default value for class attribute
(RUF012)
[warning] 12-18: Mutable default value for class attribute
(RUF012)
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandonistfan, thanks for the endorsement! To summarize the recommendation for the PR author:The file
tcf_website/migrations/0024_forumcategory_forumpost_forumresponse_question_title_and_more.pyonly contains a singleAddFieldoperation forQuestion.title, but its name implies the creation ofForumCategory,ForumPost, andForumResponsemodels — none of which exist in this file. This is likely scaffolding left over from an earlier, broader plan.Recommended action:
0024_question_title.pyand update thedependenciesreference in0025_question_instructor_optional.pyto match the new name.