From c1a772f5433382a6003c652f2d0fecb3dbd7f71a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Fri, 15 Mar 2019 22:35:14 +0100
Subject: [PATCH] remove alfortville custom extension (#31454)

---
 MANIFEST.in                                   |   1 -
 welco/contrib/alfortville/__init__.py         |  26 --
 .../alfortville/management/__init__.py        |   0
 .../management/commands/__init__.py           |   0
 .../management/commands/send-avis-email.py    |  55 ---
 .../alfortville/migrations/0001_initial.py    |  27 --
 .../migrations/0002_auto_20151009_1331.py     |  31 --
 .../migrations/0003_inbox_comments.py         |  20 --
 .../migrations/0004_auto_20151016_1523.py     |  20 --
 .../migrations/0005_auto_20151016_1523.py     |  20 --
 .../0006_inbox_last_update_timestamp.py       |  19 -
 .../alfortville/migrations/__init__.py        |   0
 welco/contrib/alfortville/models.py           |  44 ---
 .../templates/alfortville/avis-email_body.txt |   9 -
 .../alfortville/avis-email_subject.txt        |   1 -
 .../templates/alfortville/copies.html         |  37 --
 .../templates/alfortville/dg-table.html       |  63 ----
 .../alfortville/mail-table-waiting.html       |  45 ---
 .../templates/alfortville/mail-table.html     |  77 -----
 welco/contrib/alfortville/urls.py             |  40 ---
 welco/contrib/alfortville/views.py            | 326 ------------------
 welco/settings.py                             |   4 -
 welco/sources/mail/forms.py                   |   6 -
 welco/sources/mail/models.py                  |  27 --
 welco/templates/welco/qualification.html      |  22 --
 25 files changed, 920 deletions(-)
 delete mode 100644 welco/contrib/alfortville/__init__.py
 delete mode 100644 welco/contrib/alfortville/management/__init__.py
 delete mode 100644 welco/contrib/alfortville/management/commands/__init__.py
 delete mode 100644 welco/contrib/alfortville/management/commands/send-avis-email.py
 delete mode 100644 welco/contrib/alfortville/migrations/0001_initial.py
 delete mode 100644 welco/contrib/alfortville/migrations/0002_auto_20151009_1331.py
 delete mode 100644 welco/contrib/alfortville/migrations/0003_inbox_comments.py
 delete mode 100644 welco/contrib/alfortville/migrations/0004_auto_20151016_1523.py
 delete mode 100644 welco/contrib/alfortville/migrations/0005_auto_20151016_1523.py
 delete mode 100644 welco/contrib/alfortville/migrations/0006_inbox_last_update_timestamp.py
 delete mode 100644 welco/contrib/alfortville/migrations/__init__.py
 delete mode 100644 welco/contrib/alfortville/models.py
 delete mode 100644 welco/contrib/alfortville/templates/alfortville/avis-email_body.txt
 delete mode 100644 welco/contrib/alfortville/templates/alfortville/avis-email_subject.txt
 delete mode 100644 welco/contrib/alfortville/templates/alfortville/copies.html
 delete mode 100644 welco/contrib/alfortville/templates/alfortville/dg-table.html
 delete mode 100644 welco/contrib/alfortville/templates/alfortville/mail-table-waiting.html
 delete mode 100644 welco/contrib/alfortville/templates/alfortville/mail-table.html
 delete mode 100644 welco/contrib/alfortville/urls.py
 delete mode 100644 welco/contrib/alfortville/views.py

diff --git a/MANIFEST.in b/MANIFEST.in
index 3be7c1f..e0a5bc1 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -12,7 +12,6 @@ recursive-include welco/contacts/templates *.html
 recursive-include welco/sources/counter/templates *.html
 recursive-include welco/sources/phone/templates *.html
 recursive-include welco/sources/mail/templates *.html
-recursive-include welco/contrib/alfortville/templates *.html *.txt
 
 include COPYING README
 include MANIFEST.in
diff --git a/welco/contrib/alfortville/__init__.py b/welco/contrib/alfortville/__init__.py
deleted file mode 100644
index cab37e2..0000000
--- a/welco/contrib/alfortville/__init__.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# welco - multichannel request processing
-# Copyright (C) 2015  Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-import django.apps
-
-class AppConfig(django.apps.AppConfig):
-    name = 'welco.contrib.alfortville'
-
-    def get_before_urls(self):
-        from . import urls
-        return urls.urlpatterns
-
-default_app_config = 'welco.contrib.alfortville.AppConfig'
diff --git a/welco/contrib/alfortville/management/__init__.py b/welco/contrib/alfortville/management/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/welco/contrib/alfortville/management/commands/__init__.py b/welco/contrib/alfortville/management/commands/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/welco/contrib/alfortville/management/commands/send-avis-email.py b/welco/contrib/alfortville/management/commands/send-avis-email.py
deleted file mode 100644
index 6209197..0000000
--- a/welco/contrib/alfortville/management/commands/send-avis-email.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# welco - multichannel request processing
-# Copyright (C) 2015-2016  Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.conf import settings
-from django.contrib.auth import get_user_model
-from django.contrib.contenttypes.models import ContentType
-from django.core.mail import EmailMessage, send_mass_mail
-from django.core.management.base import BaseCommand, CommandError
-from django.template.loader import render_to_string
-
-from hobo.agent.common.models import Role
-from welco.contrib.alfortville.models import Inbox
-from welco.sources.mail.models import Mail
-
-
-class Command(BaseCommand):
-    def handle(self, *args, **kwargs):
-        ctx = {}
-        ctx.update(getattr(settings, 'TEMPLATE_VARS', {}))
-
-        subject = render_to_string(['alfortville/avis-email_subject.txt'], ctx).strip()
-        message = render_to_string(['alfortville/avis-email_body.txt'], ctx)
-        mails = []
-
-        relevant_mails = Mail.objects.filter(status='done-dga')
-        content_type = ContentType.objects.get_for_model(Mail)
-
-        User = get_user_model()
-        for user in User.objects.all():
-            user_roles = [x.uuid for x in Role.objects.filter(user=user)]
-            avis = Inbox.objects.filter(
-                    role_slug__in=user_roles,
-                    source_type=content_type,
-                    source_pk__in=[x.id for x in relevant_mails],
-                    subtype__in=[Inbox.MANDATORY_AVIS, Inbox.AVIS],
-                    done=False)
-            if avis.count() == 0:
-                continue
-            mails.append((subject, message, settings.DEFAULT_FROM_EMAIL, [user.email]))
-
-        if mails:
-            send_mass_mail(mails)
diff --git a/welco/contrib/alfortville/migrations/0001_initial.py b/welco/contrib/alfortville/migrations/0001_initial.py
deleted file mode 100644
index 6788f46..0000000
--- a/welco/contrib/alfortville/migrations/0001_initial.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('qualif', '0003_association_comments'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Inbox',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('role_slug', models.CharField(max_length=50)),
-                ('subtype', models.PositiveSmallIntegerField(default=1, choices=[(1, b'info'), (2, b'avis')])),
-                ('done', models.BooleanField(default=False)),
-                ('qualif', models.ForeignKey(to='qualif.Association')),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-    ]
diff --git a/welco/contrib/alfortville/migrations/0002_auto_20151009_1331.py b/welco/contrib/alfortville/migrations/0002_auto_20151009_1331.py
deleted file mode 100644
index be70a26..0000000
--- a/welco/contrib/alfortville/migrations/0002_auto_20151009_1331.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('contenttypes', '0001_initial'),
-        ('alfortville', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.RemoveField(
-            model_name='inbox',
-            name='qualif',
-        ),
-        migrations.AddField(
-            model_name='inbox',
-            name='source_pk',
-            field=models.PositiveIntegerField(null=True),
-            preserve_default=True,
-        ),
-        migrations.AddField(
-            model_name='inbox',
-            name='source_type',
-            field=models.ForeignKey(to='contenttypes.ContentType', null=True),
-            preserve_default=True,
-        ),
-    ]
diff --git a/welco/contrib/alfortville/migrations/0003_inbox_comments.py b/welco/contrib/alfortville/migrations/0003_inbox_comments.py
deleted file mode 100644
index ed3d219..0000000
--- a/welco/contrib/alfortville/migrations/0003_inbox_comments.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('alfortville', '0002_auto_20151009_1331'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='inbox',
-            name='comments',
-            field=models.TextField(verbose_name='Comments', blank=True),
-            preserve_default=True,
-        ),
-    ]
diff --git a/welco/contrib/alfortville/migrations/0004_auto_20151016_1523.py b/welco/contrib/alfortville/migrations/0004_auto_20151016_1523.py
deleted file mode 100644
index e17cf0b..0000000
--- a/welco/contrib/alfortville/migrations/0004_auto_20151016_1523.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('alfortville', '0003_inbox_comments'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='inbox',
-            name='subtype',
-            field=models.PositiveSmallIntegerField(default=1, choices=[(1, b'info'), (2, b'avis'), (3, b'mandatory-avis')]),
-            preserve_default=True,
-        ),
-    ]
diff --git a/welco/contrib/alfortville/migrations/0005_auto_20151016_1523.py b/welco/contrib/alfortville/migrations/0005_auto_20151016_1523.py
deleted file mode 100644
index b053299..0000000
--- a/welco/contrib/alfortville/migrations/0005_auto_20151016_1523.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('alfortville', '0004_auto_20151016_1523'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='inbox',
-            name='comments',
-            field=models.TextField(null=True, verbose_name='Comments', blank=True),
-            preserve_default=True,
-        ),
-    ]
diff --git a/welco/contrib/alfortville/migrations/0006_inbox_last_update_timestamp.py b/welco/contrib/alfortville/migrations/0006_inbox_last_update_timestamp.py
deleted file mode 100644
index f2b19ce..0000000
--- a/welco/contrib/alfortville/migrations/0006_inbox_last_update_timestamp.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('alfortville', '0005_auto_20151016_1523'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='inbox',
-            name='last_update_timestamp',
-            field=models.DateTimeField(auto_now=True, null=True),
-        ),
-    ]
diff --git a/welco/contrib/alfortville/migrations/__init__.py b/welco/contrib/alfortville/migrations/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/welco/contrib/alfortville/models.py b/welco/contrib/alfortville/models.py
deleted file mode 100644
index cb1d12e..0000000
--- a/welco/contrib/alfortville/models.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# welco - multichannel request processing
-# Copyright (C) 2015  Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.contrib.contenttypes.models import ContentType
-from django.contrib.contenttypes.fields import GenericForeignKey
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-
-from hobo.agent.common.models import Role
-
-
-class Inbox(models.Model):
-    INFO = 1
-    AVIS = 2
-    MANDATORY_AVIS = 3
-
-    role_slug = models.CharField(max_length=50)
-    subtype = models.PositiveSmallIntegerField(
-            choices=((INFO, 'info'),
-                     (AVIS, 'avis'),
-                     (MANDATORY_AVIS, 'mandatory-avis')),
-            default=INFO)
-    source_type = models.ForeignKey(ContentType, null=True)
-    source_pk = models.PositiveIntegerField(null=True)
-    source = GenericForeignKey('source_type', 'source_pk')
-    done = models.BooleanField(default=False)
-    comments = models.TextField(blank=True, null=True, verbose_name=_('Comments'))
-    last_update_timestamp = models.DateTimeField(auto_now=True, null=True)
-
-    def role_name(self):
-        return Role.objects.get(uuid=self.role_slug).name
diff --git a/welco/contrib/alfortville/templates/alfortville/avis-email_body.txt b/welco/contrib/alfortville/templates/alfortville/avis-email_body.txt
deleted file mode 100644
index e60de9c..0000000
--- a/welco/contrib/alfortville/templates/alfortville/avis-email_body.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Bonjour,
-
-Vous avez des avis à donner sur des courriers (avis requis et/ou avis
-demandés).
-
-Pour prendre connaissance des courriers et déposer vos avis, merci de vous
-rendre sur :
-
-{{ portal_agent_url }}
diff --git a/welco/contrib/alfortville/templates/alfortville/avis-email_subject.txt b/welco/contrib/alfortville/templates/alfortville/avis-email_subject.txt
deleted file mode 100644
index 8c7155f..0000000
--- a/welco/contrib/alfortville/templates/alfortville/avis-email_subject.txt
+++ /dev/null
@@ -1 +0,0 @@
-Avis attendus sur des courriers
diff --git a/welco/contrib/alfortville/templates/alfortville/copies.html b/welco/contrib/alfortville/templates/alfortville/copies.html
deleted file mode 100644
index b418524..0000000
--- a/welco/contrib/alfortville/templates/alfortville/copies.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{% extends "welco/base.html" %}
-{% load i18n static %}
-
-{% block content %}
-
-<form method="POST">
-{% csrf_token %}
-<table class="avis">
-  <thead>
-    <tr>
-      <td></td>
-      <th>Pour information</th>
-      <th>Pour avis facultatif</th>
-      <th>Pour avis requis</th>
-    </tr>
-  </thead>
-  <tbody>
-  {% for role in roles %}
-    <tr>
-      <th>{{role.text}}</th>
-      <td><input name="info" value="{{role.slug}}" type="checkbox"
-        {% if role.slug in checked_info %}checked="checked"{% endif %}/></td>
-      <td><input name="avis" value="{{role.slug}}" type="checkbox"
-        {% if role.slug in checked_avis %}checked="checked"{% endif %}/></td>
-      <td><input name="mandatory_avis" value="{{role.slug}}" type="checkbox"
-        {% if role.slug in checked_mandatory_avis %}checked="checked"{% endif %}/></td>
-    </tr>
-  {% endfor %}
-  </tbody>
-</table>
-<div class="buttons">
-        <button>{% trans 'Save' %}</button>
-        <button class="cancel">{% trans 'Cancel' %}</button>
-</div>
-</form>
-
-{% endblock %}
diff --git a/welco/contrib/alfortville/templates/alfortville/dg-table.html b/welco/contrib/alfortville/templates/alfortville/dg-table.html
deleted file mode 100644
index 86b9563..0000000
--- a/welco/contrib/alfortville/templates/alfortville/dg-table.html
+++ /dev/null
@@ -1,63 +0,0 @@
-{% extends "welco/base.html" %}
-{% load i18n static %}
-
-{% block bodyargs %}class="mail-dg-table"{% endblock %}
-
-{% block breadcrumb %}
-{{block.super}}
-<a href=".">{{home_screen_title}}</a>
-{% endblock %}
-
-{% block content %}
-
-<form method="post" action="qualif-many">
-<div class="source-mail all">
-<div class="cell document top">
-{% if source.get_queryset %}
-<div>
-<table class="main">
-<thead>
- <th>{% trans 'Post Date' %}</th>
- <th>{% trans 'Reference' %}</th>
- <th>{% trans 'Subject' %}</th>
- <th>{% trans 'User' %}</th>
- <th>{% trans 'Category' %}</th>
- <th>{% trans 'Related Forms' %}</th>
- <th><input type="checkbox" title="{% trans "Click to (un)toggle all mails" %}" id="click-all-pks"/></th>
-</thead>
-<tbody>
-{% for object in mails %}
-<tr data-mail-id="{{object.id}}">
-  <td class="r">{{object.post_date|date:"d F Y"|lower}}</td>
-  <td class="r">{{object.reference|default:'-'}}</td>
-  <td class="r">{{object.subject|default:'-'}}</td>
-  <td class="r">{{object.contact_name }}</td>
-  <td class="r">{{object.categories|join:", " }}</td>
-  <td class="r">{% for association in object.associations.all %}{{association.formdef_name}}{% if not forloop.last %}, {%  endif %}{% endfor %}</td>
-  <td><input type="checkbox" name="pks" value="{{object.id}}"/></td>
-</tr>
-{% endfor %}
-</tbody>
-<script>
-$('td.r').click(function() {
-  window.open('../?' + $(this).parent().data('mail-id'), target='_welco_dg');
-});
-$('input#click-all-pks').click(function(e) {
-  $('input[name="pks"]').prop('checked', $(this).prop('checked'));
-});
-</script>
-</table>
-</div>
-<div id="dg-transmit">
-{% csrf_token %}
-<button>Transmettre</button>
-</form>
-{%else %}
-<p class="no-mail-table">
-{% trans 'There is currently no mail in this list.' %}
-</p>
-{% endif %}
-</div>
-</div>
-
-{% endblock %}
diff --git a/welco/contrib/alfortville/templates/alfortville/mail-table-waiting.html b/welco/contrib/alfortville/templates/alfortville/mail-table-waiting.html
deleted file mode 100644
index e282804..0000000
--- a/welco/contrib/alfortville/templates/alfortville/mail-table-waiting.html
+++ /dev/null
@@ -1,45 +0,0 @@
-{% extends "welco/base.html" %}
-{% load i18n static %}
-
-{% block bodyargs %}class="mail-table mail-table-waiting"{% endblock %}
-
-{% block content %}
-
-<div class="source-mail all">
-<div class="cell document top">
-{% if objects %}
-<h2>{% trans 'Pending Mails' %}</h2>
-<div>
-<table class="main">
-<thead>
- <th>{% trans 'Post Date' %}</th>
- <th>{% trans 'Reference' %}</th>
- <th>{% trans 'Subject' %}</th>
- <th>{% trans 'Related Forms' %}</th>
- <th>{% trans 'Status' %}</th>
-</thead>
-<tbody>
-{% for object in objects %}
-<tr>
-  <td>{{object.post_date|default:'-'}}</td>
-  <td>{{object.reference|default:'-'}}</td>
-  <td>{{object.subject|default:'-'}}</td>
-  <td>{% for association in object.associations.all %}{{association.formdef_name}}{% if not forloop.last %}, {%  endif %}{% endfor %}</td>
-  <td>{% if object.status == 'done-qualif' %}En attente de validation DGS
-      {% elif object.status == 'done-dgs' %}En attente de validation DGA
-      {% else %}En attente de qualification
-      {% endif %}</td>
-</tr>
-{% endfor %}
-</tbody>
-</table>
-</div>
-{%else %}
-<p class="no-mail-table">
-{% trans 'There is currently no mail in this list.' %}
-</p>
-{% endif %}
-</div>
-</div>
-
-{% endblock %}
diff --git a/welco/contrib/alfortville/templates/alfortville/mail-table.html b/welco/contrib/alfortville/templates/alfortville/mail-table.html
deleted file mode 100644
index e586451..0000000
--- a/welco/contrib/alfortville/templates/alfortville/mail-table.html
+++ /dev/null
@@ -1,77 +0,0 @@
-{% extends "welco/base.html" %}
-{% load i18n static %}
-
-{% block bodyargs %}class="mail-table mail-table-subtype{{subtype}}"{% endblock %}
-
-{% block content %}
-
-{% if objects %}
-<div class="source-mail all">
-<div class="cell document top">
-<h2>{{title}}</h2>
-<div>
-<div class="mails source">
-<ul>
-{% for object in objects %}
-<li
-    data-source-pk="{{object.source.id}}"
-    data-pdf-href="{{object.source.content.url}}">
-  {{object.source.creation_timestamp}}
-  {% for association in object.source.associations.all %}
-  <br/><span data-formdata-url="{{association.formdata_url}}">{{association.formdef_name}}</span>
-  {% endfor %}
-</li>
-{% endfor %}
-</ul>
-</div>
-		<div id="postit" class="readonly" style="display: none"
-			data-base-url="{% url 'mail-edit-note' %}"
-			>
-		</div>
-<iframe id="pdf-viewer" src="{% url 'mail-viewer' %}" style="width: 100%;
-          height: 100%; border: 0;">
-</iframe>
-</div>
-</div>
-
-<div class="cell">
-</div>
-
-<div class="cell mark-as-seen">
-<form method="POST">
-  {% csrf_token %}
-  {% if display_comments_field %}
-  <textarea name="comments" id="comments-field" placeholder="{% trans "Comments" %}"></textarea>
-  {% endif %}
-  <input type="hidden" name="object-pk"></input>
-  <button>{{ button_text }}</button>
-</form>
-</div>
-
-</div>
-
-<script>
-$(function() {
-  $('[data-pdf-href]').on('welco:mail-selected', function() {
-    $('input[name="object-pk"]').val($(this).data('source-pk'));
-  });
-});
-</script>
-{% else %}
-<!-- nothing -->
-
-<div class="source-mail all">
-<div class="cell document top">
-<h2>{{title}}</h2>
-
-<p class="no-mail-table">
-{% trans 'There is currently no mail in this list.' %}
-</p>
-
-</div>
-</div>
-
-
-{% endif %}
-
-{% endblock %}
diff --git a/welco/contrib/alfortville/urls.py b/welco/contrib/alfortville/urls.py
deleted file mode 100644
index 26f1324..0000000
--- a/welco/contrib/alfortville/urls.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# welco - multichannel request processing
-# Copyright (C) 2015  Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.conf.urls import url
-
-from .views import (dgs, dga, copies, copies_ajax, table_info, table_avis,
-        table_mandatory_avis, table_waiting, count_dgs, count_dga, count_info,
-        count_avis, count_mandatory_avis, dgs_qualif_many, dga_qualif_many)
-
-urlpatterns = [
-    url(r'^dgs/(?P<table>table/)?$', dgs, name='alfortville-dgs'),
-    url(r'^dga/(?P<table>table/)?$', dga, name='alfortville-dga'),
-    url(r'^dgs/table/qualif-many$', dgs_qualif_many, name='alfortville-dgs-qualif-many'),
-    url(r'^dga/table/qualif-many$', dga_qualif_many, name='alfortville-dga-qualif-many'),
-    url(r'^copies/(?P<pk>\w+)/$', copies, name='alfortville-copies'),
-    url(r'^ajax/copies/(?P<pk>\w+)/$', copies_ajax, name='alfortville-copies-ajax'),
-    url(r'^table/info/$', table_info, name='alfortville-table-info'),
-    url(r'^table/avis/$', table_avis, name='alfortville-table-avis'),
-    url(r'^table/avis-requis/$', table_mandatory_avis, name='alfortville-table-mandatory-avis'),
-    url(r'^table/en-attente/$', table_waiting, name='alfortville-table-waiting'),
-
-    url(r'^ajax/count/dgs/$', count_dgs, name='alfortville-count-dgs'),
-    url(r'^ajax/count/dga/$', count_dga, name='alfortville-count-dga'),
-    url(r'^ajax/count/info/$', count_info, name='alfortville-count-info'),
-    url(r'^ajax/count/avis/$', count_avis, name='alfortville-count-avis'),
-    url(r'^ajax/count/avis-requis/$', count_mandatory_avis, name='alfortville-count-avis-requis'),
-]
diff --git a/welco/contrib/alfortville/views.py b/welco/contrib/alfortville/views.py
deleted file mode 100644
index 2da4bd1..0000000
--- a/welco/contrib/alfortville/views.py
+++ /dev/null
@@ -1,326 +0,0 @@
-# welco - multichannel request processing
-# Copyright (C) 2015  Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-import json
-import logging
-
-from django.conf import settings
-from django.contrib.auth.decorators import login_required
-from django.contrib.contenttypes.models import ContentType
-from django.core.urlresolvers import reverse
-from django.db.models import Q
-from django.http import HttpResponse, HttpResponseRedirect
-from django.utils.translation import ugettext_lazy as _
-from django.views.generic import TemplateView, DetailView
-
-from hobo.agent.common.models import Role
-
-from .models import Inbox
-
-from welco.sources.mail.models import Mail
-from welco.sources.mail.views import Home as MailOriginalHome
-from welco.qualif.models import Association
-from welco.utils import get_wcs_data, get_wcs_options, response_for_json
-from welco.views import HomeMail as HomeScreen
-
-
-class MailHome(MailOriginalHome):
-    def get_template(self):
-        return super(MailHome, self).get_template()
-
-
-class DgsMailHome(MailHome):
-    display_filter = True
-    allow_reject = False
-
-    def get_queryset(self):
-        return Mail.objects.filter(status='done-qualif')
-
-
-class DgHomeScreen(HomeScreen):
-    def get_template_names(self):
-        if self.kwargs.get('table') == 'table/':
-            return ['alfortville/dg-table.html']
-        return [self.template_name]
-
-    def get_context_data(self, **kwargs):
-        context = super(DgHomeScreen, self).get_context_data(**kwargs)
-        context['home_screen_title'] = self.home_screen_title
-        context['mails'] = context['source'].get_queryset()
-        return context
-
-
-class Dgs(DgHomeScreen):
-    source_klass = DgsMailHome
-    home_screen_title = _('DGS Validation')
-
-    def check_user_ok(self):
-        return 'DGS' in [x.name for x in self.request.user.groups.all()]
-
-dgs = login_required(Dgs.as_view())
-
-
-def is_dga_role(role_name):
-    return bool(role_name.startswith('DGA') or role_name.startswith('DGD') or
-                role_name.startswith('Cabinet'))
-
-
-class DgaMailHome(MailHome):
-    display_filter = True
-    allow_reject = False
-
-    def filter_formdef_condition(self, formdef):
-        roles = set()
-        for function_role in formdef.get('functions', {}).values():
-            if is_dga_role(function_role.get('role', {}).get('name', '')):
-                roles.add(function_role.get('role').get('slug'))
-        return self.user_roles.intersection(roles)
-
-    def get_queryset(self):
-        mellon = self.request.session['mellon_session']
-        params = {'NameID': mellon['name_id_content']}
-        self.user_roles = set([x['slug'] for x in get_wcs_data('api/user/', params).get('user_roles')])
-        formdef_references = []
-        for category in get_wcs_options('api/formdefs/', self.filter_formdef_condition):
-            formdef_references.extend([x[0] for x in category[1]])
-        return Mail.objects.filter(status='done-dgs',
-                associations__formdef_reference__in=formdef_references)
-
-class Dga(DgHomeScreen):
-    source_klass = DgaMailHome
-    home_screen_title = _('DGA Validation')
-
-    def check_user_ok(self):
-        user_roles = [x.name for x in self.request.user.groups.all()]
-        return any([x for x in user_roles if is_dga_role(x)])
-
-dga = login_required(Dga.as_view())
-
-
-class QualifMixin(object):
-    def get(self, request, *args, **kwargs):
-        return HttpResponseRedirect(self.get_redirect_url())
-
-    def post(self, request, *args, **kwargs):
-        source_pks = request.POST.getlist('pks')
-        logger = logging.getLogger(__name__)
-        validation_steps = settings.VALIDATION_STEPS.get('mail')
-        mail_content_type = ContentType.objects.get_for_model(Mail)
-        allowed_mails = [str(x.id) for x in self.source_klass(request).get_queryset()]
-        mail_ids = set(source_pks).intersection(set(allowed_mails))
-        for mail in Mail.objects.filter(id__in=mail_ids):
-            if mail.status:
-                mail.status = validation_steps[
-                        validation_steps.index(mail.status)+1]
-            else:
-                mail.status = validation_steps[0]
-            if mail.status == validation_steps[-1]:
-                for association in Association.objects.filter(
-                        source_type=mail_content_type,
-                        source_pk=mail.id):
-                    try:
-                        association.push(request)
-                    except Exception, e:
-                        logger.exception('error pushing mail')
-                        continue
-            mail.save()
-        return HttpResponseRedirect(self.get_redirect_url())
-
-
-class DgaQualifMany(QualifMixin, Dga):
-    def get_redirect_url(self):
-        return reverse('alfortville-dga', kwargs={'table': 'table/'})
-
-dga_qualif_many = login_required(DgaQualifMany.as_view())
-
-
-class DgsQualifMany(QualifMixin, Dgs):
-    def get_redirect_url(self):
-        return reverse('alfortville-dgs', kwargs={'table': 'table/'})
-
-dgs_qualif_many = login_required(DgsQualifMany.as_view())
-
-
-class Copies(DetailView):
-    model = Mail
-    template_name = 'alfortville/copies.html'
-
-    def get_context_data(self, **kwargs):
-        context = super(Copies, self).get_context_data(**kwargs)
-        checked_dicts = {
-            Inbox.MANDATORY_AVIS: {},
-            Inbox.AVIS: {},
-            Inbox.INFO: {},
-        }
-        for inbox in Inbox.objects.filter(source_pk=self.object.id):
-            checked_dicts[inbox.subtype][inbox.role_slug] = True
-        context['checked_info'] = checked_dicts[Inbox.INFO]
-        context['checked_avis'] = checked_dicts[Inbox.AVIS]
-        context['checked_mandatory_avis'] = checked_dicts[Inbox.MANDATORY_AVIS]
-        context['roles'] = []
-        all_roles = get_wcs_data('api/roles').get('data')
-        for start in ('Maire', 'Cabinet', 'Adjoint', 'Conseiller', 'Elu', 'DGS', 'DGD',
-                      'DGA', 'Direction'):
-            roles = [x for x in all_roles if x['text'].startswith(start)]
-            roles.sort(lambda x, y: cmp(x['text'], y['text']))
-            context['roles'].extend(roles)
-        return context
-
-    def post(self, request, *args, **kwargs):
-        lists = {
-            Inbox.MANDATORY_AVIS: request.POST.getlist('mandatory_avis'),
-            Inbox.AVIS: request.POST.getlist('avis'),
-            Inbox.INFO: request.POST.getlist('info'),
-        }
-        for subtype in lists.keys():
-            Inbox.objects.filter(subtype=subtype).filter(
-                    source_pk=kwargs['pk']).exclude(
-                    role_slug__in=lists[subtype]).delete()
-        mail_content_type = ContentType.objects.get_for_model(Mail)
-        for subtype in lists.keys():
-            for role_slug in lists[subtype]:
-                Inbox.objects.get_or_create(source_type=mail_content_type,
-                        source_pk=kwargs['pk'], role_slug=role_slug, subtype=subtype)
-        return HttpResponseRedirect('.')
-
-copies = login_required(Copies.as_view())
-
-
-def copies_ajax(request, *args, **kwargs):
-    roles_by_slug = {}
-    for role in get_wcs_data('api/roles').get('data'):
-        roles_by_slug[role['slug']] = role
-    lists = {
-        Inbox.MANDATORY_AVIS: [],
-        Inbox.AVIS: [],
-        Inbox.INFO: []
-    }
-    for inbox in Inbox.objects.filter(source_pk=kwargs.get('pk')):
-        lists[inbox.subtype].append(roles_by_slug[inbox.role_slug]['text'])
-    response = HttpResponse(content_type='application/json')
-    json.dump({'info': ', '.join(lists[Inbox.INFO]) or '-',
-               'avis': ', '.join(lists[Inbox.AVIS]) or '-',
-               'mandatory_avis': ', '.join(lists[Inbox.MANDATORY_AVIS]) or '-'},
-               response, indent=2)
-    return response
-
-
-class MailTable(TemplateView):
-    template_name = 'alfortville/mail-table.html'
-    button_text = _('Next')
-
-    def get_context_data(self, *args, **kwargs):
-        context = super(MailTable, self).get_context_data(**kwargs)
-        params = {}
-        if self.request.session.get('mellon_session'):
-            mellon = self.request.session['mellon_session']
-            params['NameID'] = mellon['name_id_content']
-
-        user_roles = [x.uuid for x in Role.objects.filter(user=self.request.user)]
-
-        mails = Mail.objects.filter(status='done-dga')
-        content_type = ContentType.objects.get_for_model(Mail)
-        context['objects'] = Inbox.objects.filter(
-                role_slug__in=user_roles,
-                source_type=content_type,
-                source_pk__in=[x.id for x in mails],
-                subtype=self.subtype, done=False).order_by('source_pk').distinct('source_pk')
-
-        context['subtype'] = self.subtype
-        context['button_text'] = self.button_text
-        context['title'] = self.title
-        context['display_comments_field'] = True
-
-        return context
-
-    def post(self, request, *args, **kwargs):
-        user_roles = [x.uuid for x in Role.objects.filter(user=self.request.user)]
-        content_type = ContentType.objects.get_for_model(Mail)
-        Inbox.objects.filter(
-                source_type=content_type,
-                source_pk__in=request.POST.getlist('object-pk'),
-                role_slug__in=user_roles,
-                subtype=self.subtype).update(
-                        done=True,
-                        comments=request.POST.get('comments'))
-        return HttpResponseRedirect('.')
-
-
-class TableMandatoryAvis(MailTable):
-    subtype = Inbox.MANDATORY_AVIS
-    title = _('Mandatory Avis Copies')
-
-table_mandatory_avis = login_required(TableMandatoryAvis.as_view())
-
-
-class TableAvis(MailTable):
-    subtype = Inbox.AVIS
-    title = _('Avis Copies')
-
-table_avis = login_required(TableAvis.as_view())
-
-
-class TableInfo(MailTable):
-    subtype = Inbox.INFO
-    title = _('Info Copies')
-
-table_info = login_required(TableInfo.as_view())
-
-
-class TableWaiting(TemplateView):
-    template_name = 'alfortville/mail-table-waiting.html'
-
-    def get_context_data(self, *args, **kwargs):
-        context = super(TableWaiting, self).get_context_data(**kwargs)
-
-        content_type = ContentType.objects.get_for_model(Mail)
-        context['objects'] = Mail.objects.filter(
-                status__in=('', 'done-qualif', 'done-dgs')).order_by('creation_timestamp')
-        return context
-
-table_waiting = login_required(TableWaiting.as_view())
-
-
-@login_required
-def count_dgs(request, *args, **kwargs):
-    count = DgsMailHome(request).get_queryset().count()
-    return response_for_json(request, {'count': count})
-
-@login_required
-def count_dga(request, *args, **kwargs):
-    count = DgaMailHome(request).get_queryset().count()
-    return response_for_json(request, {'count': count})
-
-@login_required
-def count_info(request, *args, **kwargs):
-    table = TableInfo()
-    table.request = request
-    count = table.get_context_data().get('objects').count()
-    return response_for_json(request, {'count': count})
-
-@login_required
-def count_avis(request, *args, **kwargs):
-    table = TableAvis()
-    table.request = request
-    count = table.get_context_data().get('objects').count()
-    return response_for_json(request, {'count': count})
-
-@login_required
-def count_mandatory_avis(request, *args, **kwargs):
-    table = TableMandatoryAvis()
-    table.request = request
-    count = table.get_context_data().get('objects').count()
-    return response_for_json(request, {'count': count})
diff --git a/welco/settings.py b/welco/settings.py
index 28d427a..83bb858 100644
--- a/welco/settings.py
+++ b/welco/settings.py
@@ -224,10 +224,6 @@ PHONE_MAX_CALL_DURATION = 0  # in minutes, 0 stands for infinity
 # as a phone line number and take it automatically.
 PHONE_AUTOTAKE_MELLON_USERNAME = False
 
-# enable/disable specific features
-# ex: FLAVOURS = ['alfortville']
-FLAVOURS = []
-
 REST_FRAMEWORK = {}
 REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authentication.BasicAuthentication']
 
diff --git a/welco/sources/mail/forms.py b/welco/sources/mail/forms.py
index a00f435..b49e766 100644
--- a/welco/sources/mail/forms.py
+++ b/welco/sources/mail/forms.py
@@ -23,9 +23,3 @@ class MailQualificationForm(forms.Form):
     registered_mail_number = forms.CharField(label=_('Registered Mail Number'), required=False)
     reference = forms.CharField(label=_('Reference'), required=False, widget=forms.HiddenInput)
     subject = forms.CharField(label=_('Subject'), required=False, widget=forms.HiddenInput)
-
-    def __init__(self, *args, **kwargs):
-        super(MailQualificationForm, self).__init__(*args, **kwargs)
-        if 'alfortville' in getattr(settings, 'FLAVOURS', []):
-            self.fields['reference'].widget = forms.TextInput()
-            self.fields['subject'].widget = forms.TextInput()
diff --git a/welco/sources/mail/models.py b/welco/sources/mail/models.py
index f3b42bd..d50d199 100644
--- a/welco/sources/mail/models.py
+++ b/welco/sources/mail/models.py
@@ -44,7 +44,6 @@ class Mail(models.Model):
     note = models.TextField(_('Note'), null=True)
     external_id = models.CharField(_('External Id'), null=True, max_length=32)
 
-    # used only if settings.FLAVOURS contains 'alfortville'
     reference = models.CharField(_('Reference'), null=True, max_length=30)
     subject = models.CharField(_('Subject'), null=True, max_length=200)
 
@@ -69,35 +68,12 @@ class Mail(models.Model):
             'post_date': self.post_date,
             'registered_mail_number': self.registered_mail_number,
         }
-        if 'alfortville' in getattr(settings, 'FLAVOURS', []):
-            data['reference'] = self.reference
-            data['subject'] = self.subject
         return self.get_qualification_form_class()(data)
 
     @classmethod
     def get_qualification_form_submit_url(cls):
         return reverse('qualif-mail-save')
 
-    # TODO: get_info_roles(), get_avis() and get_mandatory_avis() are custom to
-    # alfortville, they shouldn't appear in this file.
-    def get_info_roles(self):
-        from welco.contrib.alfortville.models import Inbox
-        return Inbox.objects.filter(subtype=Inbox.INFO,
-                source_type=ContentType.objects.get_for_model(Mail),
-                source_pk=self.id)
-
-    def get_avis(self):
-        from welco.contrib.alfortville.models import Inbox
-        return Inbox.objects.filter(subtype=Inbox.AVIS,
-                source_type=ContentType.objects.get_for_model(Mail),
-                source_pk=self.id)
-
-    def get_mandatory_avis(self):
-        from welco.contrib.alfortville.models import Inbox
-        return Inbox.objects.filter(subtype=Inbox.MANDATORY_AVIS,
-                source_type=ContentType.objects.get_for_model(Mail),
-                source_pk=self.id)
-
     def contact_name(self):
         if not self.contact_id:
             return ''
@@ -128,9 +104,6 @@ class Mail(models.Model):
             'registered_mail_number': self.registered_mail_number,
             'external_id': self.external_id,
         }
-        if 'alfortville' in getattr(settings, 'FLAVOURS', []):
-            context['reference'] = self.reference
-            context['subject'] = self.subject
         return context
 
 
diff --git a/welco/templates/welco/qualification.html b/welco/templates/welco/qualification.html
index 4032e3f..3fc21e9 100644
--- a/welco/templates/welco/qualification.html
+++ b/welco/templates/welco/qualification.html
@@ -21,28 +21,6 @@
 		<button class="add">{% trans 'Add' %}</button>
 	</div>
 
-	{% if source_type_name == 'mail' %}
-	<!-- special alfortville stuff, this should be factored out -->
-	<div id="copies">
-	  <p><strong>Copies</strong> (<a rel="popup" data-inplace-submit="true" href="{% url 'alfortville-copies' pk=source_pk %}">{% trans 'Edit' %}</a>)</p>
-	  <p class="info">Pour information : <span>...</span></p>
-	  <p class="avis">Pour avis facultatif : <span>...</span></p>
-	  <p class="mandatory_avis">Pour avis requis : <span>...</span></p>
-	  <script>$('#copies').trigger('welco:load-copies');</script>
-	</div>
-	{% endif %}
-
-	{% if associations|length %}
-	  <div class="done">
-	  {% if validation_steps %}
-	    {% for validation_step in validation_steps %}
-	    <button class="done" data-action-url="{% url 'qualif-done' %}?step={{validation_step.id}}">{{validation_step.label}}</button>
-	    {% endfor %}
-	  {% else %}
-	    <button class="done" data-action-url="{% url 'qualif-done' %}">{% trans 'Submit' %}</button>
-	  {% endif %}
-	  </div>
-	{% endif %}
 </form>
 {% endif %}
 </div>
-- 
2.20.1

