wip/75442-upgrade-hooks #67
|
@ -2,27 +2,27 @@
|
|||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.1.0
|
||||
rev: v3.3.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ['--keep-percent-format', '--py37-plus']
|
||||
args: ['--keep-percent-format', '--py39-plus']
|
||||
- repo: https://github.com/adamchainz/django-upgrade
|
||||
rev: 1.10.0
|
||||
rev: 1.13.0
|
||||
hooks:
|
||||
- id: django-upgrade
|
||||
args: ['--target-version', '2.2']
|
||||
args: ['--target-version', '3.2']
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.3.0
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110']
|
||||
args: ['--target-version', 'py39', '--skip-string-normalization', '--line-length', '110']
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.12.0
|
||||
hooks:
|
||||
- id: isort
|
||||
args: ['--profile', 'black', '--line-length', '110']
|
||||
- repo: https://github.com/rtts/djhtml
|
||||
rev: 'v1.5.2'
|
||||
rev: '3.0.5'
|
||||
hooks:
|
||||
- id: djhtml
|
||||
args: ['--tabwidth', '2']
|
||||
|
|
2
README
2
README
|
@ -110,7 +110,7 @@ djhtml is used to automatically indent html files, using those parameters:
|
|||
|
||||
django-upgrade is used to automatically upgrade Django syntax, using those parameters:
|
||||
|
||||
django-upgrade --target-version 2.2
|
||||
django-upgrade --target-version 3.2
|
||||
|
||||
There is .pre-commit-config.yaml to use pre-commit to automatically run these tools
|
||||
before commits. (execute `pre-commit install` to install the git hook.)
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2017-2018 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
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.assets'
|
||||
verbose_name = _('Assets')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def get_extra_manager_actions(self):
|
||||
return [{'href': reverse('combo-manager-assets'), 'text': _('Assets')}]
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.assets.AppConfig'
|
|
@ -0,0 +1,32 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2017-2018 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
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.assets'
|
||||
verbose_name = _('Assets')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def get_extra_manager_actions(self):
|
||||
return [{'href': reverse('combo-manager-assets'), 'text': _('Assets')}]
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('assets', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
<td class="actions">
|
||||
{% if asset.key %}{# theme asset #}
|
||||
<a href="{% url 'combo-manager-slot-asset-upload' key=asset.key %}{% if cell_reference %}?cell_reference={{ cell_reference }}{% endif %}"
|
||||
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
|
||||
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
|
||||
{% if asset.asset %}
|
||||
<a href="{% url 'combo-manager-slot-asset-delete' key=asset.key %}{% if cell_reference %}?cell_reference={{ cell_reference }}{% endif %}"
|
||||
class="delete" rel="popup">{% trans 'Delete' %}</a>
|
||||
class="delete" rel="popup">{% trans 'Delete' %}</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="{% url 'combo-manager-asset-overwrite' %}?img={{asset.filepath|iriencode}}"
|
||||
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
|
||||
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
|
||||
<a href="{% url 'combo-manager-asset-delete' %}?img={{asset.filepath|iriencode}}"
|
||||
class="delete" rel="popup">{% trans 'Delete' %}</a>
|
||||
class="delete" rel="popup">{% trans 'Delete' %}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2017 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.calendar'
|
||||
verbose_name = _('Calendar')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.calendar.AppConfig'
|
|
@ -0,0 +1,28 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2017 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.calendar'
|
||||
verbose_name = _('Calendar')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('data', '0027_page_picture'),
|
||||
('auth', '0006_require_contenttypes_0002'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('calendar', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('calendar', '0002_bookingcalendar_days_displayed'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('calendar', '0003_bookingcalendar_template_name'),
|
||||
]
|
||||
|
|
|
@ -28,7 +28,6 @@ from .utils import get_calendar_context_vars, get_chrono_events, is_chrono_enabl
|
|||
|
||||
@register_cell_class
|
||||
class BookingCalendar(CellBase):
|
||||
|
||||
title = models.CharField(_('Title'), max_length=128, blank=True, null=True)
|
||||
agenda_reference = models.CharField(_('Agenda'), max_length=128)
|
||||
formdef_reference = models.CharField(_('Form'), max_length=128)
|
||||
|
|
|
@ -26,7 +26,6 @@ from .utils import get_calendar_context_vars, get_chrono_events, get_form_url_wi
|
|||
|
||||
|
||||
class BookingView(SingleObjectMixin, View):
|
||||
|
||||
http_method_names = ['post']
|
||||
model = BookingCalendar
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2014-2017 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.
|
||||
|
||||
import django.apps
|
||||
from django.utils.timezone import now, timedelta
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.dashboard'
|
||||
verbose_name = _('Dashboard')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def hourly(self):
|
||||
self.clean_autotiles()
|
||||
|
||||
def clean_autotiles(self):
|
||||
from combo.data.models import ConfigJsonCell
|
||||
|
||||
ConfigJsonCell.objects.filter(
|
||||
placeholder='_auto_tile', last_update_timestamp__lte=now() - timedelta(days=2)
|
||||
).delete()
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.dashboard.AppConfig'
|
|
@ -0,0 +1,36 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2014-2017 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.
|
||||
|
||||
import django.apps
|
||||
from django.utils.timezone import now, timedelta
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.dashboard'
|
||||
verbose_name = _('Dashboard')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def hourly(self):
|
||||
self.clean_autotiles()
|
||||
|
||||
def clean_autotiles(self):
|
||||
from combo.data.models import ConfigJsonCell
|
||||
|
||||
ConfigJsonCell.objects.filter(
|
||||
placeholder='_auto_tile', last_update_timestamp__lte=now() - timedelta(days=2)
|
||||
).delete()
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0002_auto_20180105_0846'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0003_dashboardcell_template_name'),
|
||||
]
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
{% for tile in tiles %}
|
||||
{% with cell=tile.cell %}
|
||||
<div class="cell {{ cell.css_class_names }} {% if cell.slug %}{{cell.slug}}{% endif %}"
|
||||
data-ajax-cell-url="{{ site_base }}{{ cell.get_ajax_url }}"
|
||||
data-ajax-cell-loading-message="{{ cell.loading_message }}"
|
||||
data-ajax-cell-error-message="{% trans "Loading error" %}"
|
||||
{% if cell.ajax_refresh %}
|
||||
data-ajax-cell-refresh="{{ cell.ajax_refresh }}"
|
||||
{% endif %}><div>{% render_cell cell %}</div></div>
|
||||
data-ajax-cell-url="{{ site_base }}{{ cell.get_ajax_url }}"
|
||||
data-ajax-cell-loading-message="{{ cell.loading_message }}"
|
||||
data-ajax-cell-error-message="{% trans "Loading error" %}"
|
||||
{% if cell.ajax_refresh %}
|
||||
data-ajax-cell-refresh="{{ cell.ajax_refresh }}"
|
||||
{% endif %}><div>{% render_cell cell %}</div></div>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
# combo - content management system
|
||||
# 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.dataviz'
|
||||
verbose_name = _('Data Visualisation')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def hourly(self):
|
||||
from .models import ChartNgCell
|
||||
from .utils import update_available_statistics
|
||||
|
||||
update_available_statistics()
|
||||
for cell in ChartNgCell.objects.all():
|
||||
cell.check_validity()
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.dataviz.AppConfig'
|
|
@ -0,0 +1,36 @@
|
|||
# combo - content management system
|
||||
# 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.dataviz'
|
||||
verbose_name = _('Data Visualisation')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def hourly(self):
|
||||
from .models import ChartNgCell
|
||||
from .utils import update_available_statistics
|
||||
|
||||
update_available_statistics()
|
||||
for cell in ChartNgCell.objects.all():
|
||||
cell.check_validity()
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0001_initial'),
|
||||
('data', '0012_auto_20151029_1535'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0001_initial'),
|
||||
('data', '0012_auto_20151029_1535'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0003_cubesbarchart_cubestable'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0004_auto_20160108_1048'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('data', '0020_auto_20160928_1152'),
|
||||
('dataviz', '0005_auto_20160928_1152'),
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.utils.timezone import utc
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0006_chartcell'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0007_auto_20170214_2006'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0008_auto_20190328_0857'),
|
||||
]
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
# Generated by Django 1.11.12 on 2019-03-28 10:11
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import migrations, models
|
||||
from django.db.models import JSONField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('data', '0036_page_sub_slug'),
|
||||
('dataviz', '0009_auto_20190617_1214'),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0010_auto_20190328_1111'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0011_auto_20200813_1100'),
|
||||
]
|
||||
|
|
|
@ -28,7 +28,6 @@ def update_cells(apps, schema_editor):
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0012_auto_20201126_1557'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0013_update_chartng_cells'),
|
||||
]
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
# Generated by Django 1.11.29 on 2020-12-02 13:24
|
||||
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import migrations
|
||||
from django.db.models import JSONField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0014_auto_20201130_1534'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ from combo.apps.dataviz.models import TIME_FILTERS
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0015_auto_20201202_1424'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ from combo.utils.db import EnsureJsonbType
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0016_auto_20201215_1624'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0017_text_to_jsonb'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ import combo.data.models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0018_auto_20210723_1318'),
|
||||
]
|
||||
|
|
|
@ -17,7 +17,6 @@ def update_time_intervals(apps, schema_editor):
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0019_auto_20211006_1525'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('data', '0051_link_cell_max_length'),
|
||||
('auth', '0011_update_proxy_permissions'),
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0021_chartfilterscell'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0022_chartngcell_subfilters'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0023_statistic_has_future_data'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0024_display_condition'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0025_statistic_data_type'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dataviz', '0026_chartfilterscell_filters'),
|
||||
]
|
||||
|
|
|
@ -24,8 +24,8 @@ import pygal
|
|||
import pygal.util
|
||||
from dateutil.relativedelta import MO, relativedelta
|
||||
from django.conf import settings
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import models, transaction
|
||||
from django.db.models import JSONField
|
||||
|
||||
from django.template import RequestContext, Template, TemplateSyntaxError, VariableDoesNotExist
|
||||
from django.template.defaultfilters import date as format_date
|
||||
from django.urls import reverse
|
||||
|
@ -608,7 +608,6 @@ class ChartNgCell(CellBase):
|
|||
return new_data
|
||||
|
||||
def sort_values(self, chart, data):
|
||||
|
||||
if self.sort_order == 'alpha':
|
||||
digit_re = re.compile('([0-9]+)')
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import django
|
||||
from django import forms
|
||||
|
||||
|
||||
|
@ -23,15 +22,8 @@ class MultiSelectWidget(forms.MultiWidget):
|
|||
self.widgets.append(forms.Select(attrs=self.attrs, choices=self.choices))
|
||||
|
||||
# all subwidgets must have the same name
|
||||
if django.VERSION >= (3, 1):
|
||||
self.widgets_names = [''] * len(self.widgets)
|
||||
return super().get_context(name, value, attrs)
|
||||
else:
|
||||
context = super().get_context(name, value, attrs)
|
||||
subwidgets = context['widget']['subwidgets']
|
||||
for widget in subwidgets:
|
||||
widget['name'] = widget['name'].rsplit('_', 1)[0]
|
||||
return context
|
||||
self.widgets_names = [''] * len(self.widgets)
|
||||
return super().get_context(name, value, attrs)
|
||||
|
||||
def decompress(self, value):
|
||||
return value or []
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2021 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.family'
|
||||
verbose_name = _('Family')
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.family.AppConfig'
|
|
@ -0,0 +1,23 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2021 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.family'
|
||||
verbose_name = _('Family')
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0001_initial'),
|
||||
('data', '0010_feedcell'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0002_familyinfoscell_restricted_to_unlogged'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.utils.timezone import utc
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0003_familyinfoscell_extra_css_class'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0004_familyinfoscell_last_update_timestamp'),
|
||||
]
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0011_update_proxy_permissions'),
|
||||
('data', '0047_auto_20210723_1318'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0006_weekly_agenda_cell'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0007_weekly_agenda_user_template'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0008_clean'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0009_agenda_references_template'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0010_agenda_references_template'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ import combo.data.models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0011_agenda_subscribed_and_dates'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('family', '0012_booking_form_url'),
|
||||
]
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
{% if day.weekday == 0 %}
|
||||
{% with sunday=day|add_days:6 %}
|
||||
<div class="weekly-agenda-cell--week-title {% if current_week == day|date:'W' %}current{% endif %}"
|
||||
{% if booking_form_url %}data-edit-url="{{ booking_form_url }}{% if '?' in booking_form_url %}&{% else %}?{% endif %}current={{ day|adjust_to_week_monday|date:'Y-m-d' }}"{% endif %}>
|
||||
{% if booking_form_url %}data-edit-url="{{ booking_form_url }}{% if '?' in booking_form_url %}&{% else %}?{% endif %}current={{ day|adjust_to_week_monday|date:'Y-m-d' }}"{% endif %}>
|
||||
{% blocktrans with day_date=day|date:'d/m' sunday_date=sunday|date:'d/m' %}Week<br class="weekbreak"> of {{ day_date }} to {{ sunday_date }}{% endblocktrans %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 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/>.
|
||||
|
||||
import django.apps
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.fargo'
|
||||
verbose_name = _('Portfolio')
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.fargo.AppConfig'
|
|
@ -0,0 +1,23 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 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/>.
|
||||
|
||||
import django.apps
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.fargo'
|
||||
verbose_name = _('Portfolio')
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0001_initial'),
|
||||
('data', '0013_parameterscell'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.utils.timezone import utc
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0002_recentdocumentscell_extra_css_class'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0003_recentdocumentscell_last_update_timestamp'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0004_recentdocumentscell_fargo_site'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0005_recentdocumentscell_template_name'),
|
||||
]
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
# combo - content management system
|
||||
# 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.gallery'
|
||||
verbose_name = _('Gallery')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.gallery.AppConfig'
|
|
@ -0,0 +1,28 @@
|
|||
# combo - content management system
|
||||
# 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.gallery'
|
||||
verbose_name = _('Gallery')
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0001_initial'),
|
||||
('data', '0005_auto_20150226_0903'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gallery', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gallery', '0002_image_title'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gallery', '0003_gallerycell_title'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gallery', '0004_auto_20210723_1318'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gallery', '0005_display_condition'),
|
||||
]
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{% thumbnail image.image "60x60" crop="50% 25%" as im %}
|
||||
{% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
|
||||
<a data-image-large="{{ im_large.url }}" class="image-switch" href=""><img src="{{ im.url }}"
|
||||
{% if image.title %} title="{{image.title}}" {% endif %}/></a>
|
||||
{% if image.title %} title="{{image.title}}" {% endif %}/></a>
|
||||
{% endthumbnail %}
|
||||
{% endthumbnail %}
|
||||
{% endfor %}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2020 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.kb'
|
||||
verbose_name = _('Knowledge Base')
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.kb.AppConfig'
|
|
@ -0,0 +1,23 @@
|
|||
# combo - content management system
|
||||
# Copyright (C) 2020 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
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.kb'
|
||||
verbose_name = _('Knowledge Base')
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('kb', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('kb', '0002_auto_20200203_1137'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('kb', '0003_latestpageupdatescell_template_name'),
|
||||
]
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
# lingo - basket and payment system
|
||||
# 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 datetime
|
||||
import logging
|
||||
|
||||
import django.apps
|
||||
import eopayment
|
||||
from django.db import transaction
|
||||
from django.db.models.signals import post_migrate
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.lingo'
|
||||
verbose_name = _('Payment')
|
||||
|
||||
def ready(self):
|
||||
post_migrate.connect(self.post_migrate_handler, sender=self)
|
||||
|
||||
def post_migrate_handler(self, **kwargs):
|
||||
from .models import PaymentBackend
|
||||
|
||||
with transaction.atomic():
|
||||
for payment_backend in PaymentBackend.objects.all():
|
||||
service_options = payment_backend.service_options
|
||||
transaction_options = {}
|
||||
for parameter in payment_backend.eopayment.get_parameters(scope='transaction'):
|
||||
name = parameter['name']
|
||||
if name in service_options:
|
||||
transaction_options[name] = service_options.pop(name)
|
||||
if not transaction_options:
|
||||
continue
|
||||
payment_backend.save()
|
||||
for regie in payment_backend.regie_set.all():
|
||||
# merge old values in new transactions options
|
||||
regie.transaction_options = dict(transaction_options, **regie.transaction_options)
|
||||
regie.save()
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def get_extra_manager_actions(self):
|
||||
return [{'href': reverse('lingo-manager-homepage'), 'text': _('Online Payment')}]
|
||||
|
||||
def hourly(self):
|
||||
self.update_transactions()
|
||||
self.notify_payments()
|
||||
|
||||
def update_transactions(self):
|
||||
from .models import EXPIRED, Transaction
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
now = timezone.now()
|
||||
to_expire = Transaction.objects.filter(
|
||||
start_date__lt=now - datetime.timedelta(hours=1), end_date__isnull=True
|
||||
)
|
||||
for transaction in to_expire:
|
||||
logger.info('transaction %r is expired', transaction.order_id)
|
||||
transaction.status = EXPIRED
|
||||
transaction.save()
|
||||
|
||||
to_retry = Transaction.objects.filter(
|
||||
status__in=(eopayment.PAID, eopayment.ACCEPTED),
|
||||
to_be_paid_remote_items__isnull=False,
|
||||
start_date__gt=now - datetime.timedelta(days=4),
|
||||
)
|
||||
for transaction in to_retry:
|
||||
transaction.retry_notify_remote_items_of_payments()
|
||||
|
||||
def notify_payments(self):
|
||||
from combo.apps.lingo.models import BasketItem
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
now = timezone.now()
|
||||
for item in BasketItem.objects.filter(
|
||||
notification_date__isnull=True,
|
||||
cancellation_date__isnull=True,
|
||||
payment_date__lt=now - datetime.timedelta(minutes=5),
|
||||
payment_date__gt=now - datetime.timedelta(minutes=300),
|
||||
):
|
||||
try:
|
||||
item.notify_payment()
|
||||
except Exception:
|
||||
logger.exception('error in async notification for basket item %s', item.id)
|
||||
|
||||
|
||||
default_app_config = 'combo.apps.lingo.AppConfig'
|
|
@ -19,8 +19,6 @@ from django.contrib import admin
|
|||
from .models import Regie
|
||||
|
||||
|
||||
@admin.register(Regie)
|
||||
class RegieAdmin(admin.ModelAdmin):
|
||||
prepopulated_fields = {'slug': ('label',)}
|
||||
|
||||
|
||||
admin.site.register(Regie, RegieAdmin)
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
# lingo - basket and payment system
|
||||
# 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 datetime
|
||||
import logging
|
||||
|
||||
import django.apps
|
||||
import eopayment
|
||||
from django.db import transaction
|
||||
from django.db.models.signals import post_migrate
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
name = 'combo.apps.lingo'
|
||||
verbose_name = _('Payment')
|
||||
|
||||
def ready(self):
|
||||
post_migrate.connect(self.post_migrate_handler, sender=self)
|
||||
|
||||
def post_migrate_handler(self, **kwargs):
|
||||
from .models import PaymentBackend
|
||||
|
||||
with transaction.atomic():
|
||||
for payment_backend in PaymentBackend.objects.all():
|
||||
service_options = payment_backend.service_options
|
||||
transaction_options = {}
|
||||
for parameter in payment_backend.eopayment.get_parameters(scope='transaction'):
|
||||
name = parameter['name']
|
||||
if name in service_options:
|
||||
transaction_options[name] = service_options.pop(name)
|
||||
if not transaction_options:
|
||||
continue
|
||||
payment_backend.save()
|
||||
for regie in payment_backend.regie_set.all():
|
||||
# merge old values in new transactions options
|
||||
regie.transaction_options = dict(transaction_options, **regie.transaction_options)
|
||||
regie.save()
|
||||
|
||||
def get_before_urls(self):
|
||||
from . import urls
|
||||
|
||||
return urls.urlpatterns
|
||||
|
||||
def get_extra_manager_actions(self):
|
||||
return [{'href': reverse('lingo-manager-homepage'), 'text': _('Online Payment')}]
|
||||
|
||||
def hourly(self):
|
||||
self.update_transactions()
|
||||
self.notify_payments()
|
||||
|
||||
def update_transactions(self):
|
||||
from .models import EXPIRED, Transaction
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
now = timezone.now()
|
||||
to_expire = Transaction.objects.filter(
|
||||
start_date__lt=now - datetime.timedelta(hours=1), end_date__isnull=True
|
||||
)
|
||||
for transaction in to_expire:
|
||||
logger.info('transaction %r is expired', transaction.order_id)
|
||||
transaction.status = EXPIRED
|
||||
transaction.save()
|
||||
|
||||
to_retry = Transaction.objects.filter(
|
||||
status__in=(eopayment.PAID, eopayment.ACCEPTED),
|
||||
to_be_paid_remote_items__isnull=False,
|
||||
start_date__gt=now - datetime.timedelta(days=4),
|
||||
)
|
||||
for transaction in to_retry:
|
||||
transaction.retry_notify_remote_items_of_payments()
|
||||
|
||||
def notify_payments(self):
|
||||
from combo.apps.lingo.models import BasketItem
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
now = timezone.now()
|
||||
for item in BasketItem.objects.filter(
|
||||
notification_date__isnull=True,
|
||||
cancellation_date__isnull=True,
|
||||
payment_date__lt=now - datetime.timedelta(minutes=5),
|
||||
payment_date__gt=now - datetime.timedelta(minutes=300),
|
||||
):
|
||||
try:
|
||||
item.notify_payment()
|
||||
except Exception:
|
||||
logger.exception('error in async notification for basket item %s', item.id)
|
|
@ -1,10 +1,9 @@
|
|||
from django.conf import settings
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import migrations, models
|
||||
from django.db.models import JSONField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import migrations, models
|
||||
from django.db.models import JSONField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lingo', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lingo', '0002_transaction'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lingo', '0003_auto_20150306_1047'),
|
||||
]
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
pas de changement dans les migrations ?
Zut, bien vu, un peu nul django-upgrade sur ce coup là apparemment c'est voulu qu'il ne touche pas aux migrations https://github.com/adamchainz/django-upgrade#jsonfield mais je ne comprends pas la raison.