From a247af64358aa008b5cc6470dea7e950c62ab77d Mon Sep 17 00:00:00 2001
From: George Katsikas <giorgakis.katsikas@gmail.com>
Date: Mon, 9 Oct 2023 13:23:50 +0200
Subject: [PATCH] make prod stream opened field editable by factory

---
 .../0010_alter_productionstream_opened.py     | 19 +++++++++++++++++++
 scipost_django/production/models.py           |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 scipost_django/production/migrations/0010_alter_productionstream_opened.py

diff --git a/scipost_django/production/migrations/0010_alter_productionstream_opened.py b/scipost_django/production/migrations/0010_alter_productionstream_opened.py
new file mode 100644
index 000000000..1bf0c8b86
--- /dev/null
+++ b/scipost_django/production/migrations/0010_alter_productionstream_opened.py
@@ -0,0 +1,19 @@
+# Generated by Django 3.2.18 on 2023-10-06 15:27
+
+from django.db import migrations, models
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('production', '0009_productionstream_on_hold'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='productionstream',
+            name='opened',
+            field=models.DateTimeField(default=django.utils.timezone.now),
+        ),
+    ]
diff --git a/scipost_django/production/models.py b/scipost_django/production/models.py
index b3fbdb7ce..f8f283eea 100644
--- a/scipost_django/production/models.py
+++ b/scipost_django/production/models.py
@@ -73,7 +73,7 @@ class ProductionStream(models.Model):
         on_delete=models.CASCADE,
         related_name="production_stream",
     )
-    opened = models.DateTimeField(auto_now_add=True)
+    opened = models.DateTimeField(default=timezone.now)
     closed = models.DateTimeField(default=timezone.now)
     status = models.CharField(
         max_length=32,
-- 
GitLab