Skip to content
Snippets Groups Projects
Verified Commit c9409a94 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Make person field for PDFFile optional

(cherry picked from commit d4cc128a)
parent a811b018
No related branches found
No related tags found
1 merge request!691Prepare release 2.0rc3
# Generated by Django 3.2.4 on 2021-07-24 13:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0019_fix_uniqueness_per_site'),
]
operations = [
migrations.AlterField(
model_name='pdffile',
name='person',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pdf_files', to='core.person', verbose_name='Owner'),
),
]
......@@ -1037,7 +1037,12 @@ class PDFFile(ExtensibleModel):
return timezone.now() + timedelta(minutes=get_site_preferences()["general__pdf_expiration"])
person = models.ForeignKey(
to=Person, on_delete=models.CASCADE, verbose_name=_("Owner"), related_name="pdf_files"
to=Person,
on_delete=models.CASCADE,
blank=True,
null=True,
verbose_name=_("Owner"),
related_name="pdf_files",
)
expires_at = models.DateTimeField(
verbose_name=_("File expires at"), default=_get_default_expiration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment