summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-03-28 11:09:53 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-03-28 11:10:59 +0200
commit8beff03e0f1b32d4540df6c656446c95d2993dbb (patch)
tree7c0359dc421698f20e544f469394a0fa2ea929b5
parent633da250abe1d2b243564a3c014e28b96e80aebe (diff)
downloadIshtar-8beff03e0f1b32d4540df6c656446c95d2993dbb.tar.bz2
Ishtar-8beff03e0f1b32d4540df6c656446c95d2993dbb.zip
Make step by step import an experimental feature (refs #3975)
-rw-r--r--ishtar_common/migrations/0037_ishtarsiteprofile_experimental_feature.py20
-rw-r--r--ishtar_common/models.py4
-rw-r--r--ishtar_common/models_imports.py8
3 files changed, 29 insertions, 3 deletions
diff --git a/ishtar_common/migrations/0037_ishtarsiteprofile_experimental_feature.py b/ishtar_common/migrations/0037_ishtarsiteprofile_experimental_feature.py
new file mode 100644
index 000000000..df2e0be3b
--- /dev/null
+++ b/ishtar_common/migrations/0037_ishtarsiteprofile_experimental_feature.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2018-03-28 10:57
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0036_auto_20180323_2053'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='experimental_feature',
+ field=models.BooleanField(default=False, verbose_name='Activate experimental feature'),
+ ),
+ ]
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 6518ea763..8f8117b6c 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1537,6 +1537,9 @@ class IshtarSiteProfile(models.Model, Cached):
slug_field = 'slug'
label = models.TextField(_(u"Name"))
slug = models.SlugField(_(u"Slug"), unique=True)
+ active = models.BooleanField(_(u"Current active"), default=False)
+ experimental_feature = models.BooleanField(
+ _(u"Activate experimental feature"), default=False)
description = models.TextField(_(u"Description"), null=True, blank=True)
files = models.BooleanField(_(u"Files module"), default=False)
archaeological_site = models.BooleanField(
@@ -1626,7 +1629,6 @@ class IshtarSiteProfile(models.Model, Cached):
u"Change this with care. With incorrect formula, the "
u"application might be unusable and import of external "
u"data can be destructive."))
- active = models.BooleanField(_(u"Current active"), default=False)
currency = models.CharField(_(u"Currency"), default=u"€",
choices=CURRENCY, max_length=5)
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py
index cd8865eca..9afd435da 100644
--- a/ishtar_common/models_imports.py
+++ b/ishtar_common/models_imports.py
@@ -896,17 +896,21 @@ class Import(models.Model):
"""
Get available action relevant with the current status
"""
+ from ishtar_common.models import IshtarSiteProfile
+ profile = IshtarSiteProfile.get_current_profile()
actions = []
if self.state == 'C':
actions.append(('A', _(u"Analyse")))
if self.state == 'A':
actions.append(('A', _(u"Re-analyse")))
actions.append(('I', _(u"Launch import")))
- actions.append(('IS', _(u"Step by step import")))
+ if profile.experimental_feature:
+ actions.append(('IS', _(u"Step by step import")))
if self.state in ('F', 'FE'):
actions.append(('A', _(u"Re-analyse")))
actions.append(('I', _(u"Re-import")))
- actions.append(('IS', _(u"Step by step import")))
+ if profile.experimental_feature:
+ actions.append(('IS', _(u"Step by step import")))
actions.append(('AC', _(u"Archive")))
if self.state == 'AC':
actions.append(('A', _(u"Unarchive")))