Skip to content

Commit

Permalink
refactor: refactor receipt model
Browse files Browse the repository at this point in the history
  • Loading branch information
AmooHashem committed Jul 28, 2024
1 parent 21d00de commit c9833ca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 19 additions & 0 deletions apps/fsm/migrations/0146_alter_registrationreceipt_form.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.1.3 on 2024-07-28 23:01

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('fsm', '0145_remove_widget_be_corrected_problem_be_corrected'),
]

operations = [
migrations.AlterField(
model_name='registrationreceipt',
name='form',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='registration_receipts', to='fsm.registrationform'),
),
]
4 changes: 1 addition & 3 deletions apps/fsm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ class CorrectionStatus(models.TextChoices):
Other = "Other"

created_at = models.DateTimeField(auto_now_add=True, blank=True, null=True)
# should be in every answer sheet child
form = models.ForeignKey('fsm.RegistrationForm', related_name='registration_receipts', null=True, blank=True,
on_delete=models.SET_NULL)
form = models.ForeignKey('fsm.RegistrationForm', related_name='registration_receipts', on_delete=models.PROTECT)
user = models.ForeignKey(
'accounts.User', related_name='registration_receipts', on_delete=models.CASCADE)
status = models.CharField(max_length=25, blank=False,
Expand Down

0 comments on commit c9833ca

Please sign in to comment.