Updated doc, rename_app, added throttles

This commit is contained in:
Spitap
2023-04-18 15:44:08 +02:00
committed by Antoine Nguyen
parent a319b70595
commit a41c5b658e
6 changed files with 50 additions and 3 deletions
+9
View File
@@ -114,6 +114,15 @@ Specific instructions
The ``modoboa-dmarc``, ``modoboa-pdfcredentials`` and ``modoboa-imapmigration``
plugins have been merged into the core.
Add ``'django_rename_app,'`` To ``INSTALLED_APPS``:
.. sourcecode:: python
INSTALLED_APPS = (
...,
'django_rename_app',
)
Add ``'modoboa.dmarc'``, ``'modoboa.pdfcredentials'`` and ``'modoboa.imap_migration'``
to ``MODOBOA_APPS``:
@@ -69,6 +69,7 @@ INSTALLED_APPS = (
'django_otp',
'django_otp.plugins.otp_totp',
'django_otp.plugins.otp_static',
'django_rename_app',
{% if devmode %} 'djangobower',{% endif %}
)
@@ -0,0 +1,33 @@
# Generated by Django 3.2.17 on 2023-04-18 12:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dmarc', '0004_auto_20220926_0913'),
]
operations = [
migrations.AlterField(
model_name='record',
name='id',
field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='report',
name='id',
field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='reporter',
name='id',
field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='result',
name='id',
field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
+5 -3
View File
@@ -2,12 +2,13 @@
from rest_framework import filters, mixins, permissions, viewsets
from ... import models
from modoboa.lib.throttle import GetThrottleViewsetMixin
from ... import models
from . import serializers
class EmailProviderViewSet(viewsets.ModelViewSet):
class EmailProviderViewSet(GetThrottleViewsetMixin, viewsets.ModelViewSet):
"""ViewSet class for EmailProvider."""
filter_backends = (filters.SearchFilter, )
@@ -20,7 +21,8 @@ class EmailProviderViewSet(viewsets.ModelViewSet):
serializer_class = serializers.EmailProviderSerializer
class MigrationViewSet(mixins.ListModelMixin,
class MigrationViewSet(GetThrottleViewsetMixin,
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.DestroyModelMixin,
viewsets.GenericViewSet):
+1
View File
@@ -5,6 +5,7 @@ django-reversion==5.0.4
django-xforwardedfor-middleware==2.0
django-otp==1.1.6
django-filter
django-rename-app
dj-database-url
+1
View File
@@ -72,6 +72,7 @@ INSTALLED_APPS = (
'django_otp',
'django_otp.plugins.otp_totp',
'django_otp.plugins.otp_static',
'django_rename_app',
)
# A dedicated place to register Modoboa applications