summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-03-16 08:56:14 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-07-15 21:14:03 (GMT)
commitc6fc60c3c1d7a7672f2f155d091286bdae3a9563 (patch)
tree5fa515cb12eef75479023343f298c1627123d565
parent5bcd9442b9cd9bdd3e2c3f85f22374b39dc6200a (diff)
downloadwelco-c6fc60c3c1d7a7672f2f155d091286bdae3a9563.zip
welco-c6fc60c3c1d7a7672f2f155d091286bdae3a9563.tar.gz
welco-c6fc60c3c1d7a7672f2f155d091286bdae3a9563.tar.bz2
misc: remove validation steps (#31454)
-rw-r--r--welco/settings.py10
-rw-r--r--welco/templates/welco/qualification.html26
-rw-r--r--welco/urls.py1
-rw-r--r--welco/views.py42
4 files changed, 1 insertions, 78 deletions
diff --git a/welco/settings.py b/welco/settings.py
index 83bb858..02e3e58 100644
--- a/welco/settings.py
+++ b/welco/settings.py
@@ -185,16 +185,6 @@ HAYSTACK_CONNECTIONS = {
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
-# Add validation circuit on specific sources, example:
-# VALIDATION_STEPS = {'mail': ['done-qualif', 'done-dgs', 'done-dga']}
-# VALIDATION_STEP_LABELS = {
-# 'done-qualif': _('Send to DGS'),
-# 'done-dgs': _('Send to DGA'),
-# 'done-dga': _('Send to service')}
-
-VALIDATION_STEPS = {}
-VALIDATION_STEP_LABELS = {}
-
# mapping of channel to group/role *names*
CHANNEL_ROLES = {
'mail': [],
diff --git a/welco/templates/welco/qualification.html b/welco/templates/welco/qualification.html
deleted file mode 100644
index 3fc21e9..0000000
--- a/welco/templates/welco/qualification.html
+++ /dev/null
@@ -1,26 +0,0 @@
-{% load i18n %}
-<div {% if not source_pk %}class="inactive"{% endif %}>
-{% if source_pk %}
-<form>
- {% if associations|length %}
- <ul>
- {% for association in associations %}
- <li>{{association.formdef_name}}
- {% if not association.formdata_id %}
- (<a class="remove" href="{% url 'ajax-remove-association' pk=association.id %}">✖</a>)</li>
- {% endif %}
- {% endfor %}
- <li><a href="#" class="plus">{% trans 'Add another' %}</a></li>
- </ul>
- {% endif %}
-
- <div class="add-formdef-reference" {% if associations|length %}style="display: none"{% endif %}>
- <div>
- {{form.formdef_reference}}
- </div>
- <button class="add">{% trans 'Add' %}</button>
- </div>
-
-</form>
-{% endif %}
-</div>
diff --git a/welco/urls.py b/welco/urls.py
index e7e69b3..9712223 100644
--- a/welco/urls.py
+++ b/welco/urls.py
@@ -39,7 +39,6 @@ urlpatterns = [
url(r'^', include('welco.sources.phone.urls')),
url(r'^', include('welco.sources.counter.urls')),
url(r'^ajax/qualification$', welco.views.qualification, name='qualif-zone'),
- url(r'^ajax/qualification-done$', welco.views.qualification_done, name='qualif-done'),
url(r'^ajax/remove-association/(?P<pk>\w+)$',
welco.views.remove_association, name='ajax-remove-association'),
url(r'^ajax/create-formdata/(?P<pk>\w+)$',
diff --git a/welco/views.py b/welco/views.py
index d15277a..ad6ed49 100644
--- a/welco/views.py
+++ b/welco/views.py
@@ -67,13 +67,7 @@ def logout(request, next_page=None):
class Qualification(TemplateView):
- def get_template_names(self):
- source_type = ContentType.objects.get(id=self.request.GET['source_type'])
- validation_steps = settings.VALIDATION_STEPS.get(source_type.model.lower())
- if validation_steps:
- return ['welco/qualification.html']
- else:
- return ['welco/qualification_no_validation.html']
+ template_name = 'welco/qualification_no_validation.html'
def get_context_data(self, **kwargs):
context = super(Qualification, self).get_context_data(**kwargs)
@@ -86,9 +80,6 @@ class Qualification(TemplateView):
context['associations'] = Association.objects.filter(
source_type=ContentType.objects.get(id=self.request.GET['source_type']),
source_pk=self.request.GET['source_pk']).order_by('id')
- validation_steps = settings.VALIDATION_STEPS.get(source_type.model.lower()) or []
- context['validation_steps'] = [
- {'id': x, 'label': settings.VALIDATION_STEP_LABELS[x]} for x in validation_steps]
return context
def post(self, request, *args, **kwargs):
@@ -157,37 +148,6 @@ class HomeCounter(ChannelHome):
home_counter = login_required(HomeCounter.as_view())
-
-@csrf_exempt
-def qualification_done(request):
- source_class = ContentType.objects.get(
- id=request.POST['source_type']).model_class()
- source_object = source_class.objects.get(id=request.POST['source_pk'])
- validation_steps = settings.VALIDATION_STEPS.get(source_class.__name__.lower())
- if request.GET.get('step'):
- source_object.status = validation_steps[validation_steps.index(request.GET.get('step'))]
- else:
- if source_object.status:
- source_object.status = validation_steps[
- validation_steps.index(source_object.status)+1]
- else:
- source_object.status = validation_steps[0]
- if source_object.status == validation_steps[-1]:
- for association in Association.objects.filter(
- source_type=request.POST['source_type'],
- source_pk=request.POST['source_pk']):
- try:
- association.push(request)
- except Exception, e:
- response = HttpResponse(content_type='application/json')
- json.dump({'err': '1', 'msg': str(e)}, response, indent=2)
- return response
- source_object.save()
- response = HttpResponse(content_type='application/json')
- json.dump({'result': 'ok'}, response, indent=2)
- return response
-
-
@login_required
def wcs_summary(request, *args, **kwargs):
source_class = ContentType.objects.get(id=kwargs.get('source_type')).model_class()