Skip to content

Commit

Permalink
🗃️ [#4815] Change submission removal limit to 0
Browse files Browse the repository at this point in the history
Allowing submissions to be deleted after 0 days (i.e. on the same day)
  • Loading branch information
robinmolen committed Nov 11, 2024
1 parent 4c53505 commit 865a6fa
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Generated by Django 4.2.16 on 2024-11-11 14:08

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("config", "0063_merge_20240923_1612"),
]

operations = [
migrations.AlterField(
model_name="globalconfiguration",
name="all_submissions_removal_limit",
field=models.PositiveIntegerField(
default=90,
help_text="Amount of days when all submissions will be permanently deleted",
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="all submissions removal limit",
),
),
migrations.AlterField(
model_name="globalconfiguration",
name="errored_submissions_removal_limit",
field=models.PositiveIntegerField(
default=30,
help_text="Amount of days errored submissions will remain before being removed",
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="errored submission removal limit",
),
),
migrations.AlterField(
model_name="globalconfiguration",
name="incomplete_submissions_removal_limit",
field=models.PositiveIntegerField(
default=7,
help_text="Amount of days incomplete submissions will remain before being removed",
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="incomplete submission removal limit",
),
),
migrations.AlterField(
model_name="globalconfiguration",
name="successful_submissions_removal_limit",
field=models.PositiveIntegerField(
default=7,
help_text="Amount of days successful submissions will remain before being removed",
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="successful submission removal limit",
),
),
]
8 changes: 4 additions & 4 deletions src/openforms/config/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class GlobalConfiguration(SingletonModel):
successful_submissions_removal_limit = models.PositiveIntegerField(
_("successful submission removal limit"),
default=7,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_(
"Amount of days successful submissions will remain before being removed"
),
Expand All @@ -436,7 +436,7 @@ class GlobalConfiguration(SingletonModel):
incomplete_submissions_removal_limit = models.PositiveIntegerField(
_("incomplete submission removal limit"),
default=7,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_(
"Amount of days incomplete submissions will remain before being removed"
),
Expand All @@ -451,7 +451,7 @@ class GlobalConfiguration(SingletonModel):
errored_submissions_removal_limit = models.PositiveIntegerField(
_("errored submission removal limit"),
default=30,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_(
"Amount of days errored submissions will remain before being removed"
),
Expand All @@ -466,7 +466,7 @@ class GlobalConfiguration(SingletonModel):
all_submissions_removal_limit = models.PositiveIntegerField(
_("all submissions removal limit"),
default=90,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_("Amount of days when all submissions will be permanently deleted"),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Generated by Django 4.2.16 on 2024-11-11 14:08

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("forms", "0103_remove_formvariable_prefill_config_empty_or_complete_and_more"),
]

operations = [
migrations.AlterField(
model_name="form",
name="all_submissions_removal_limit",
field=models.PositiveIntegerField(
blank=True,
help_text="Amount of days when all submissions of this form will be permanently deleted. Leave blank to use value in General Configuration.",
null=True,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="all submissions removal limit",
),
),
migrations.AlterField(
model_name="form",
name="errored_submissions_removal_limit",
field=models.PositiveIntegerField(
blank=True,
help_text="Amount of days errored submissions of this form will remain before being removed. Leave blank to use value in General Configuration.",
null=True,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="errored submission removal limit",
),
),
migrations.AlterField(
model_name="form",
name="incomplete_submissions_removal_limit",
field=models.PositiveIntegerField(
blank=True,
help_text="Amount of days incomplete submissions of this form will remain before being removed. Leave blank to use value in General Configuration.",
null=True,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="incomplete submission removal limit",
),
),
migrations.AlterField(
model_name="form",
name="successful_submissions_removal_limit",
field=models.PositiveIntegerField(
blank=True,
help_text="Amount of days successful submissions of this form will remain before being removed. Leave blank to use value in General Configuration.",
null=True,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="successful submission removal limit",
),
),
]
8 changes: 4 additions & 4 deletions src/openforms/forms/models/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class Form(models.Model):
_("successful submission removal limit"),
blank=True,
null=True,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_(
"Amount of days successful submissions of this form will remain before being removed. "
"Leave blank to use value in General Configuration."
Expand All @@ -315,7 +315,7 @@ class Form(models.Model):
_("incomplete submission removal limit"),
blank=True,
null=True,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_(
"Amount of days incomplete submissions of this form will remain before being removed. "
"Leave blank to use value in General Configuration."
Expand All @@ -335,7 +335,7 @@ class Form(models.Model):
_("errored submission removal limit"),
blank=True,
null=True,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_(
"Amount of days errored submissions of this form will remain before being removed. "
"Leave blank to use value in General Configuration."
Expand All @@ -355,7 +355,7 @@ class Form(models.Model):
_("all submissions removal limit"),
blank=True,
null=True,
validators=[MinValueValidator(1)],
validators=[MinValueValidator(0)],
help_text=_(
"Amount of days when all submissions of this form will be permanently deleted. "
"Leave blank to use value in General Configuration."
Expand Down
8 changes: 4 additions & 4 deletions src/openforms/js/components/admin/form_design/DataRemoval.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const DataRemoval = ({submissionsRemovalOptions, onChange}) => {
<NumberInput
value={successfulSubmissionsRemovalLimit || ''}
onChange={onChange}
min="1"
min="0"
/>
</Field>
</FormRow>
Expand Down Expand Up @@ -109,7 +109,7 @@ const DataRemoval = ({submissionsRemovalOptions, onChange}) => {
<NumberInput
value={incompleteSubmissionsRemovalLimit || ''}
onChange={onChange}
min="1"
min="0"
/>
</Field>
</FormRow>
Expand Down Expand Up @@ -154,7 +154,7 @@ const DataRemoval = ({submissionsRemovalOptions, onChange}) => {
/>
}
>
<NumberInput value={erroredSubmissionsRemovalLimit || ''} onChange={onChange} min="1" />
<NumberInput value={erroredSubmissionsRemovalLimit || ''} onChange={onChange} min="0" />
</Field>
</FormRow>
<FormRow>
Expand Down Expand Up @@ -198,7 +198,7 @@ const DataRemoval = ({submissionsRemovalOptions, onChange}) => {
/>
}
>
<NumberInput value={allSubmissionsRemovalLimit || ''} onChange={onChange} min="1" />
<NumberInput value={allSubmissionsRemovalLimit || ''} onChange={onChange} min="0" />
</Field>
</FormRow>
</Fieldset>
Expand Down

0 comments on commit 865a6fa

Please sign in to comment.