mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-21 19:03:11 +00:00
feat: ⬆️ Support for django 2.2 (#308)
Support for django 2.2. Rename django.conf.urlresolvers. Change url to path. Add apps to app folder. Edit migrations for on_delete. Edit models for on_delete. Drop compatibility for django 1.x
This commit is contained in:
parent
37ee9e30b8
commit
6736caf9f4
51 changed files with 909 additions and 540 deletions
11
api/apps.py
Normal file
11
api/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of api app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ApiConfig(AppConfig):
|
||||
"""Configuration of api app."""
|
||||
|
||||
name = "api"
|
|
@ -26,7 +26,7 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.core.urlresolvers import NoReverseMatch
|
||||
from django.urls import NoReverseMatch
|
||||
from rest_framework import views
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.reverse import reverse
|
||||
|
|
|
@ -28,13 +28,15 @@ can also be register. That way a complete API root page presenting all URLs
|
|||
can be generated automatically.
|
||||
"""
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from django.urls import path, include
|
||||
from importlib import import_module
|
||||
|
||||
from . import views
|
||||
from .routers import AllViewsRouter
|
||||
from django.conf import settings
|
||||
|
||||
app_name = "api"
|
||||
|
||||
router = AllViewsRouter()
|
||||
|
||||
urls_viewset = []
|
||||
|
@ -65,4 +67,4 @@ for _url, view, name in urls_functional_view:
|
|||
# TOKEN AUTHENTICATION
|
||||
router.register_view(r"token-auth", views.ObtainExpiringAuthToken)
|
||||
|
||||
urlpatterns = [url(r"^", include(router.urls))]
|
||||
urlpatterns = [path("", include(router.urls))]
|
||||
|
|
11
cotisations/apps.py
Normal file
11
cotisations/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of cotisations app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CotisationsConfig(AppConfig):
|
||||
"""Configuration of cotisations app."""
|
||||
|
||||
name = "cotisations"
|
49
cotisations/migrations/0004_auto_20210208_1827.py
Normal file
49
cotisations/migrations/0004_auto_20210208_1827.py
Normal file
|
@ -0,0 +1,49 @@
|
|||
# Generated by Django 2.2.18 on 2021-02-08 17:27
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cotisations', '0003_auto_20210124_1105'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='article',
|
||||
options={'permissions': (('buy_every_article', 'Can buy every article'),), 'verbose_name': 'article', 'verbose_name_plural': 'articles'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='banque',
|
||||
options={'verbose_name': 'bank', 'verbose_name_plural': 'banks'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='baseinvoice',
|
||||
options={},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='costestimate',
|
||||
options={},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='cotisation',
|
||||
options={'permissions': (('change_all_cotisation', 'Can edit the previous subscriptions'),), 'verbose_name': 'subscription', 'verbose_name_plural': 'subscriptions'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='custominvoice',
|
||||
options={},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='facture',
|
||||
options={'permissions': (('change_facture_control', 'Can edit the "controlled" state'), ('change_all_facture', 'Can edit all the previous invoices')), 'verbose_name': 'invoice', 'verbose_name_plural': 'invoices'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='paiement',
|
||||
options={'permissions': (('use_every_payment', 'Can use every payment method'),), 'verbose_name': 'payment method', 'verbose_name_plural': 'payment methods'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='vente',
|
||||
options={'permissions': (('change_all_vente', 'Can edit all the previous purchases'),), 'verbose_name': 'purchase', 'verbose_name_plural': 'purchases'},
|
||||
),
|
||||
]
|
|
@ -40,12 +40,12 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name="cotisation",
|
||||
name="facture",
|
||||
field=models.OneToOneField(to="cotisations.Facture"),
|
||||
field=models.OneToOneField(to="cotisations.Facture", on_delete=models.CASCADE),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="vente",
|
||||
name="facture",
|
||||
field=models.ForeignKey(to="cotisations.Facture"),
|
||||
field=models.ForeignKey(to="cotisations.Facture", on_delete=models.CASCADE),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="vente",
|
||||
|
|
|
@ -41,7 +41,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name="cotisation",
|
||||
name="vente",
|
||||
field=models.OneToOneField(to="cotisations.Vente", null=True),
|
||||
field=models.OneToOneField(to="cotisations.Vente", null=True, on_delete=models.CASCADE),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
|
|
|
@ -62,9 +62,6 @@ class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
abstract = False
|
||||
permissions = (
|
||||
("view_baseinvoice", _("Can view an base invoice object")),
|
||||
)
|
||||
|
||||
# TODO : change prix to price
|
||||
def prix(self):
|
||||
|
@ -157,7 +154,6 @@ class Facture(BaseInvoice):
|
|||
permissions = (
|
||||
# TODO : change facture to invoice
|
||||
("change_facture_control", _('Can edit the "controlled" state')),
|
||||
("view_facture", _("Can view an invoice object")),
|
||||
("change_all_facture", _("Can edit all the previous invoices")),
|
||||
)
|
||||
verbose_name = _("invoice")
|
||||
|
@ -377,8 +373,6 @@ def facture_post_delete(**kwargs):
|
|||
|
||||
|
||||
class CustomInvoice(BaseInvoice):
|
||||
class Meta:
|
||||
permissions = (("view_custominvoice", _("Can view a custom invoice object")),)
|
||||
|
||||
recipient = models.CharField(max_length=255, verbose_name=_("recipient"))
|
||||
payment = models.CharField(max_length=255, verbose_name=_("payment type"))
|
||||
|
@ -388,8 +382,6 @@ class CustomInvoice(BaseInvoice):
|
|||
|
||||
|
||||
class CostEstimate(CustomInvoice):
|
||||
class Meta:
|
||||
permissions = (("view_costestimate", _("Can view a cost estimate object")),)
|
||||
|
||||
validity = models.DurationField(
|
||||
verbose_name=_("period of validity"), help_text="DD HH:MM:SS"
|
||||
|
@ -490,7 +482,6 @@ class Vente(RevMixin, AclMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_vente", _("Can view a purchase object")),
|
||||
("change_all_vente", _("Can edit all the previous purchases")),
|
||||
)
|
||||
verbose_name = _("purchase")
|
||||
|
@ -750,7 +741,6 @@ class Article(RevMixin, AclMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_article", _("Can view an article object")),
|
||||
("buy_every_article", _("Can buy every article")),
|
||||
)
|
||||
verbose_name = "article"
|
||||
|
@ -824,7 +814,6 @@ class Banque(RevMixin, AclMixin, models.Model):
|
|||
name = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_banque", _("Can view a bank object")),)
|
||||
verbose_name = _("bank")
|
||||
verbose_name_plural = _("banks")
|
||||
|
||||
|
@ -856,7 +845,6 @@ class Paiement(RevMixin, AclMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_paiement", _("Can view a payment method object")),
|
||||
("use_every_payment", _("Can use every payment method")),
|
||||
)
|
||||
verbose_name = _("payment method")
|
||||
|
@ -980,7 +968,6 @@ class Cotisation(RevMixin, AclMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_cotisation", _("Can view a subscription object")),
|
||||
("change_all_cotisation", _("Can edit the previous subscriptions")),
|
||||
)
|
||||
verbose_name = _("subscription")
|
||||
|
|
|
@ -22,7 +22,7 @@ from django.conf.urls import include, url
|
|||
from . import comnpay, cheque, note_kfet
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^comnpay/", include(comnpay.urls, namespace="comnpay")),
|
||||
url(r"^cheque/", include(cheque.urls, namespace="cheque")),
|
||||
url(r"^note_kfet/", include(note_kfet.urls, namespace="note_kfet")),
|
||||
url(r"^comnpay/", include((comnpay.urls, 'comnpay'), namespace="comnpay")),
|
||||
url(r"^cheque/", include((cheque.urls, 'cheque'), namespace="cheque")),
|
||||
url(r"^note_kfet/", include((note_kfet.urls, 'note_kfet'), namespace="note_kfet")),
|
||||
]
|
||||
|
|
|
@ -25,85 +25,87 @@ The defined URLs for the Cotisations app
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
|
||||
from . import views, views_autocomplete
|
||||
from . import payment_methods
|
||||
|
||||
app_name ="cotisations"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^new_facture/(?P<userid>[0-9]+)$", views.new_facture, name="new-facture"),
|
||||
url(
|
||||
r"^edit_facture/(?P<factureid>[0-9]+)$", views.edit_facture, name="edit-facture"
|
||||
path("new_facture/<int:userid>", views.new_facture, name="new-facture"),
|
||||
path(
|
||||
"edit_facture/<int:factureid>", views.edit_facture, name="edit-facture"
|
||||
),
|
||||
url(r"^del_facture/(?P<factureid>[0-9]+)$", views.del_facture, name="del-facture"),
|
||||
url(r"^facture_pdf/(?P<factureid>[0-9]+)$", views.facture_pdf, name="facture-pdf"),
|
||||
url(r"^voucher_pdf/(?P<factureid>[0-9]+)$", views.voucher_pdf, name="voucher-pdf"),
|
||||
url(r"^new_cost_estimate/$", views.new_cost_estimate, name="new-cost-estimate"),
|
||||
url(
|
||||
r"^index_cost_estimate/$", views.index_cost_estimate, name="index-cost-estimate"
|
||||
path("del_facture/<int:factureid>", views.del_facture, name="del-facture"),
|
||||
path("facture_pdf/<int:factureid>", views.facture_pdf, name="facture-pdf"),
|
||||
path("voucher_pdf/<int:factureid>", views.voucher_pdf, name="voucher-pdf"),
|
||||
path("new_cost_estimate", views.new_cost_estimate, name="new-cost-estimate"),
|
||||
path(
|
||||
"index_cost_estimate", views.index_cost_estimate, name="index-cost-estimate"
|
||||
),
|
||||
url(
|
||||
r"^cost_estimate_pdf/(?P<costestimateid>[0-9]+)$",
|
||||
path(
|
||||
"cost_estimate_pdf/<int:costestimateid>",
|
||||
views.cost_estimate_pdf,
|
||||
name="cost-estimate-pdf",
|
||||
),
|
||||
url(
|
||||
r"^index_custom_invoice/$",
|
||||
path(
|
||||
"index_custom_invoice",
|
||||
views.index_custom_invoice,
|
||||
name="index-custom-invoice",
|
||||
),
|
||||
url(
|
||||
r"^edit_cost_estimate/(?P<costestimateid>[0-9]+)$",
|
||||
path(
|
||||
"edit_cost_estimate/<int:costestimateid>",
|
||||
views.edit_cost_estimate,
|
||||
name="edit-cost-estimate",
|
||||
),
|
||||
url(
|
||||
r"^cost_estimate_to_invoice/(?P<costestimateid>[0-9]+)$",
|
||||
path(
|
||||
"cost_estimate_to_invoice/<int:costestimateid>",
|
||||
views.cost_estimate_to_invoice,
|
||||
name="cost-estimate-to-invoice",
|
||||
),
|
||||
url(
|
||||
r"^del_cost_estimate/(?P<costestimateid>[0-9]+)$",
|
||||
path(
|
||||
"del_cost_estimate/<int:costestimateid>",
|
||||
views.del_cost_estimate,
|
||||
name="del-cost-estimate",
|
||||
),
|
||||
url(r"^new_custom_invoice/$", views.new_custom_invoice, name="new-custom-invoice"),
|
||||
url(
|
||||
r"^edit_custom_invoice/(?P<custominvoiceid>[0-9]+)$",
|
||||
path("new_custom_invoice", views.new_custom_invoice, name="new-custom-invoice"),
|
||||
path(
|
||||
"edit_custom_invoice/<int:custominvoiceid>",
|
||||
views.edit_custom_invoice,
|
||||
name="edit-custom-invoice",
|
||||
),
|
||||
url(
|
||||
r"^custom_invoice_pdf/(?P<custominvoiceid>[0-9]+)$",
|
||||
path(
|
||||
"custom_invoice_pdf/<int:custominvoiceid>",
|
||||
views.custom_invoice_pdf,
|
||||
name="custom-invoice-pdf",
|
||||
),
|
||||
url(
|
||||
r"^del_custom_invoice/(?P<custominvoiceid>[0-9]+)$",
|
||||
path(
|
||||
"del_custom_invoice/<int:custominvoiceid>",
|
||||
views.del_custom_invoice,
|
||||
name="del-custom-invoice",
|
||||
),
|
||||
url(r"^credit_solde/(?P<userid>[0-9]+)$", views.credit_solde, name="credit-solde"),
|
||||
url(r"^add_article/$", views.add_article, name="add-article"),
|
||||
url(
|
||||
r"^edit_article/(?P<articleid>[0-9]+)$", views.edit_article, name="edit-article"
|
||||
path("credit_solde/<int:userid>", views.credit_solde, name="credit-solde"),
|
||||
path("add_article", views.add_article, name="add-article"),
|
||||
path(
|
||||
"edit_article/<int:articleid>", views.edit_article, name="edit-article"
|
||||
),
|
||||
url(r"^del_article/$", views.del_article, name="del-article"),
|
||||
url(r"^add_paiement/$", views.add_paiement, name="add-paiement"),
|
||||
url(
|
||||
r"^edit_paiement/(?P<paiementid>[0-9]+)$",
|
||||
path("del_article", views.del_article, name="del-article"),
|
||||
path("add_paiement", views.add_paiement, name="add-paiement"),
|
||||
path(
|
||||
"edit_paiement/<int:paiementid>",
|
||||
views.edit_paiement,
|
||||
name="edit-paiement",
|
||||
),
|
||||
url(r"^del_paiement/$", views.del_paiement, name="del-paiement"),
|
||||
url(r"^add_banque/$", views.add_banque, name="add-banque"),
|
||||
url(r"^edit_banque/(?P<banqueid>[0-9]+)$", views.edit_banque, name="edit-banque"),
|
||||
url(r"^del_banque/$", views.del_banque, name="del-banque"),
|
||||
url(r"^index_article/$", views.index_article, name="index-article"),
|
||||
url(r"^index_banque/$", views.index_banque, name="index-banque"),
|
||||
url(r"^index_paiement/$", views.index_paiement, name="index-paiement"),
|
||||
url(r"^control/$", views.control, name="control"),
|
||||
url(r"^$", views.index, name="index"),
|
||||
path("del_paiement", views.del_paiement, name="del-paiement"),
|
||||
path("add_banque", views.add_banque, name="add-banque"),
|
||||
path("edit_banque/<int:banqueid>", views.edit_banque, name="edit-banque"),
|
||||
path("del_banque", views.del_banque, name="del-banque"),
|
||||
path("index_article", views.index_article, name="index-article"),
|
||||
path("index_banque", views.index_banque, name="index-banque"),
|
||||
path("index_paiement", views.index_paiement, name="index-paiement"),
|
||||
path("control", views.control, name="control"),
|
||||
path("", views.index, name="index"),
|
||||
### Autocomplete Views
|
||||
url(r'^banque-autocomplete/$', views_autocomplete.BanqueAutocomplete.as_view(), name='banque-autocomplete',),
|
||||
path('banque-autocomplete', views_autocomplete.BanqueAutocomplete.as_view(), name='banque-autocomplete',),
|
||||
] + payment_methods.urls.urlpatterns
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
from .import views
|
||||
|
||||
app_name = "ldap_sync"
|
||||
|
||||
urlpatterns = []
|
||||
|
|
11
logs/apps.py
Normal file
11
logs/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of logs app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class LogsConfig(AppConfig):
|
||||
"""Configuration of logs app."""
|
||||
|
||||
name = "logs"
|
26
logs/urls.py
26
logs/urls.py
|
@ -24,26 +24,28 @@ The defined URLs for the logs app. Included in re2o.urls.
|
|||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = "logs"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", views.index, name="index"),
|
||||
url(r"^stats_logs$", views.stats_logs, name="stats-logs"),
|
||||
url(
|
||||
r"^revert_action/(?P<revision_id>[0-9]+)$",
|
||||
path("", views.index, name="index"),
|
||||
path("stats_logs", views.stats_logs, name="stats-logs"),
|
||||
path(
|
||||
"revert_action/<int:revision_id>",
|
||||
views.revert_action,
|
||||
name="revert-action",
|
||||
),
|
||||
url(
|
||||
r"(?P<application>\w+)/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$",
|
||||
path(
|
||||
"<str:application>/<str:object_name>/<int:object_id>",
|
||||
views.history,
|
||||
name="history",
|
||||
),
|
||||
url(r"^stats_general/$", views.stats_general, name="stats-general"),
|
||||
url(r"^stats_models/$", views.stats_models, name="stats-models"),
|
||||
url(r"^stats_users/$", views.stats_users, name="stats-users"),
|
||||
url(r"^stats_actions/$", views.stats_actions, name="stats-actions"),
|
||||
url(r"^stats_search_machine/$", views.stats_search_machine_history, name="stats-search-machine"),
|
||||
path("stats_general", views.stats_general, name="stats-general"),
|
||||
path("stats_models", views.stats_models, name="stats-models"),
|
||||
path("stats_users", views.stats_users, name="stats-users"),
|
||||
path("stats_actions", views.stats_actions, name="stats-actions"),
|
||||
path("stats_search_machine", views.stats_search_machine_history, name="stats-search-machine"),
|
||||
]
|
||||
|
|
11
machines/apps.py
Normal file
11
machines/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of machines app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class MachinesConfig(AppConfig):
|
||||
"""Configuration of machines app."""
|
||||
|
||||
name = "machines"
|
|
@ -1098,7 +1098,7 @@ class Migration(migrations.Migration):
|
|||
(
|
||||
"cname",
|
||||
models.ForeignKey(
|
||||
"self", null=True, blank=True, related_name="related_domain"
|
||||
"self", null=True, blank=True, related_name="related_domain", on_delete=models.CASCADE
|
||||
),
|
||||
),
|
||||
(
|
||||
|
|
108
machines/migrations/0003_auto_20210208_1827.py
Normal file
108
machines/migrations/0003_auto_20210208_1827.py
Normal file
|
@ -0,0 +1,108 @@
|
|||
# Generated by Django 2.2.18 on 2021-02-08 17:27
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('machines', '0002_foreign_keys'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='dname',
|
||||
options={'verbose_name': 'DNAME record', 'verbose_name_plural': 'DNAME records'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='domain',
|
||||
options={'permissions': (('change_ttl', 'Can change the TTL of a domain object'),), 'verbose_name': 'domain', 'verbose_name_plural': 'domains'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='extension',
|
||||
options={'permissions': (('use_all_extension', 'Can use all extensions'),), 'verbose_name': 'DNS extension', 'verbose_name_plural': 'DNS extensions'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='interface',
|
||||
options={'permissions': (('change_interface_machine', 'Can change the owner of an interface'),), 'verbose_name': 'interface', 'verbose_name_plural': 'interfaces'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='iplist',
|
||||
options={'verbose_name': 'IPv4 addresses list', 'verbose_name_plural': 'IPv4 addresses lists'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='iptype',
|
||||
options={'permissions': (('use_all_iptype', 'Can use all IP types'),), 'verbose_name': 'IP type', 'verbose_name_plural': 'IP types'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='ipv6list',
|
||||
options={'permissions': (('change_ipv6list_slaac_ip', 'Can change the SLAAC value of an IPv6 addresses list'),), 'verbose_name': 'IPv6 addresses list', 'verbose_name_plural': 'IPv6 addresses lists'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='machine',
|
||||
options={'permissions': (('change_machine_user', 'Can change the user of a machine'),), 'verbose_name': 'machine', 'verbose_name_plural': 'machines'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='machinetype',
|
||||
options={'permissions': (('use_all_machinetype', 'Can use all machine types'),), 'verbose_name': 'machine type', 'verbose_name_plural': 'machine types'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='mx',
|
||||
options={'verbose_name': 'MX record', 'verbose_name_plural': 'MX records'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='nas',
|
||||
options={'verbose_name': 'NAS device', 'verbose_name_plural': 'NAS devices'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='ns',
|
||||
options={'verbose_name': 'NS record', 'verbose_name_plural': 'NS records'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='ouvertureportlist',
|
||||
options={'verbose_name': 'ports opening list', 'verbose_name_plural': 'ports opening lists'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='role',
|
||||
options={'verbose_name': 'server role', 'verbose_name_plural': 'server roles'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='service',
|
||||
options={'verbose_name': 'service to generate (DHCP, DNS, ...)', 'verbose_name_plural': 'services to generate (DHCP, DNS, ...)'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='service_link',
|
||||
options={'verbose_name': 'link between service and server', 'verbose_name_plural': 'links between service and server'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='soa',
|
||||
options={'verbose_name': 'SOA record', 'verbose_name_plural': 'SOA records'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='srv',
|
||||
options={'verbose_name': 'SRV record', 'verbose_name_plural': 'SRV records'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='sshfp',
|
||||
options={'verbose_name': 'SSHFP record', 'verbose_name_plural': 'SSHFP records'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='txt',
|
||||
options={'verbose_name': 'TXT record', 'verbose_name_plural': 'TXT records'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='vlan',
|
||||
options={'verbose_name': 'VLAN', 'verbose_name_plural': 'VLANs'},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='domain',
|
||||
name='cname',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='related_domain', to='machines.Domain'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='iptype',
|
||||
name='ouverture_ports',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.OuverturePortList'),
|
||||
),
|
||||
]
|
|
@ -34,6 +34,6 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name="interface",
|
||||
name="machine",
|
||||
field=models.ForeignKey(to="machines.Machine"),
|
||||
field=models.ForeignKey(to="machines.Machine", on_delete=models.CASCADE),
|
||||
)
|
||||
]
|
||||
|
|
|
@ -51,7 +51,7 @@ class Migration(migrations.Migration):
|
|||
unique=True,
|
||||
),
|
||||
),
|
||||
("interface_parent", models.ForeignKey(to="machines.Interface")),
|
||||
("interface_parent", models.ForeignKey(to="machines.Interface", on_delete=models.CASCADE)),
|
||||
],
|
||||
)
|
||||
]
|
||||
|
|
|
@ -35,7 +35,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name="domain",
|
||||
name="interface_parent",
|
||||
field=models.ForeignKey(to="machines.Interface", null=True, blank=True),
|
||||
field=models.ForeignKey(to="machines.Interface", null=True, blank=True, on_delete=models.CASCADE),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name="domain", unique_together=set([("name", "extension")])
|
||||
|
|
|
@ -39,6 +39,7 @@ class Migration(migrations.Migration):
|
|||
null=True,
|
||||
to="machines.Domain",
|
||||
blank=True,
|
||||
on_delete=models.CASCADE
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
@ -39,6 +39,7 @@ class Migration(migrations.Migration):
|
|||
to="machines.Domain",
|
||||
related_name="related_domain",
|
||||
blank=True,
|
||||
on_delete=models.CASCADE,
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
@ -34,6 +34,6 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name="domain",
|
||||
name="interface_parent",
|
||||
field=models.OneToOneField(blank=True, null=True, to="machines.Interface"),
|
||||
field=models.OneToOneField(blank=True, null=True, to="machines.Interface", on_delete=models.CASCADE),
|
||||
)
|
||||
]
|
||||
|
|
|
@ -80,7 +80,6 @@ class Machine(RevMixin, FieldPermissionModelMixin, AclMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_machine", _("Can view a machine object")),
|
||||
("change_machine_user", _("Can change the user of a machine")),
|
||||
)
|
||||
verbose_name = _("machine")
|
||||
|
@ -344,7 +343,6 @@ class MachineType(RevMixin, AclMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_machinetype", _("Can view a machine type object")),
|
||||
("use_all_machinetype", _("Can use all machine types")),
|
||||
)
|
||||
verbose_name = _("machine type")
|
||||
|
@ -457,11 +455,10 @@ class IpType(RevMixin, AclMixin, models.Model):
|
|||
default=False, help_text=_("Enable reverse DNS for IPv6.")
|
||||
)
|
||||
vlan = models.ForeignKey("Vlan", on_delete=models.PROTECT, blank=True, null=True)
|
||||
ouverture_ports = models.ForeignKey("OuverturePortList", blank=True, null=True)
|
||||
ouverture_ports = models.ForeignKey("OuverturePortList", blank=True, null=True, on_delete=models.PROTECT)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_iptype", _("Can view an IP type object")),
|
||||
("use_all_iptype", _("Can use all IP types")),
|
||||
)
|
||||
verbose_name = _("IP type")
|
||||
|
@ -729,7 +726,6 @@ class Vlan(RevMixin, AclMixin, models.Model):
|
|||
mld = models.BooleanField(default=False, help_text=_("v6 multicast management."))
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_vlan", _("Can view a VLAN object")),)
|
||||
verbose_name = _("VLAN")
|
||||
verbose_name_plural = _("VLANs")
|
||||
|
||||
|
@ -765,7 +761,6 @@ class Nas(RevMixin, AclMixin, models.Model):
|
|||
autocapture_mac = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_nas", _("Can view a NAS device object")),)
|
||||
verbose_name = _("NAS device")
|
||||
verbose_name_plural = _("NAS devices")
|
||||
|
||||
|
@ -819,7 +814,6 @@ class SOA(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_soa", _("Can view an SOA record object")),)
|
||||
verbose_name = _("SOA record")
|
||||
verbose_name_plural = _("SOA records")
|
||||
|
||||
|
@ -904,7 +898,6 @@ class Extension(RevMixin, AclMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_extension", _("Can view an extension object")),
|
||||
("use_all_extension", _("Can use all extensions")),
|
||||
)
|
||||
verbose_name = _("DNS extension")
|
||||
|
@ -1037,7 +1030,6 @@ class Mx(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_mx", _("Can view an MX record object")),)
|
||||
verbose_name = _("MX record")
|
||||
verbose_name_plural = _("MX records")
|
||||
|
||||
|
@ -1069,7 +1061,6 @@ class Ns(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_ns", _("Can view an NS record object")),)
|
||||
verbose_name = _("NS record")
|
||||
verbose_name_plural = _("NS records")
|
||||
|
||||
|
@ -1101,7 +1092,6 @@ class Txt(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_txt", _("Can view a TXT record object")),)
|
||||
verbose_name = _("TXT record")
|
||||
verbose_name_plural = _("TXT records")
|
||||
|
||||
|
@ -1131,7 +1121,6 @@ class DName(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_dname", _("Can view a DNAME record object")),)
|
||||
verbose_name = _("DNAME record")
|
||||
verbose_name_plural = _("DNAME records")
|
||||
|
||||
|
@ -1195,7 +1184,6 @@ class Srv(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_srv", _("Can view an SRV record object")),)
|
||||
verbose_name = _("SRV record")
|
||||
verbose_name_plural = _("SRV records")
|
||||
|
||||
|
@ -1285,7 +1273,6 @@ class SshFp(RevMixin, AclMixin, models.Model):
|
|||
}
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_sshfp", _("Can view an SSHFP record object")),)
|
||||
verbose_name = _("SSHFP record")
|
||||
verbose_name_plural = _("SSHFP records")
|
||||
|
||||
|
@ -1350,7 +1337,6 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_interface", _("Can view an interface object")),
|
||||
("change_interface_machine", _("Can change the owner of an interface")),
|
||||
)
|
||||
verbose_name = _("interface")
|
||||
|
@ -1741,7 +1727,6 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_ipv6list", _("Can view an IPv6 addresses list object")),
|
||||
(
|
||||
"change_ipv6list_slaac_ip",
|
||||
_("Can change the SLAAC value of an IPv6 addresses list"),
|
||||
|
@ -1945,7 +1930,7 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
|||
)
|
||||
extension = models.ForeignKey("Extension", on_delete=models.PROTECT)
|
||||
cname = models.ForeignKey(
|
||||
"self", null=True, blank=True, related_name="related_domain"
|
||||
"self", null=True, blank=True, related_name="related_domain", on_delete=models.PROTECT
|
||||
)
|
||||
ttl = models.PositiveIntegerField(
|
||||
verbose_name=_("Time To Live (TTL)"),
|
||||
|
@ -1956,7 +1941,6 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
|||
class Meta:
|
||||
unique_together = (("name", "extension"),)
|
||||
permissions = (
|
||||
("view_domain", _("Can view a domain object")),
|
||||
("change_ttl", _("Can change the TTL of a domain object")),
|
||||
)
|
||||
verbose_name = _("domain")
|
||||
|
@ -2184,7 +2168,6 @@ class IpList(RevMixin, AclMixin, models.Model):
|
|||
ip_type = models.ForeignKey("IpType", on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_iplist", _("Can view an IPv4 addresses list object")),)
|
||||
verbose_name = _("IPv4 addresses list")
|
||||
verbose_name_plural = _("IPv4 addresses lists")
|
||||
|
||||
|
@ -2275,7 +2258,6 @@ class Role(RevMixin, AclMixin, models.Model):
|
|||
specific_role = models.CharField(choices=ROLE, null=True, blank=True, max_length=32)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_role", _("Can view a role object")),)
|
||||
verbose_name = _("server role")
|
||||
verbose_name_plural = _("server roles")
|
||||
|
||||
|
@ -2325,7 +2307,6 @@ class Service(RevMixin, AclMixin, models.Model):
|
|||
servers = models.ManyToManyField("Interface", through="Service_link")
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_service", _("Can view a service object")),)
|
||||
verbose_name = _("service to generate (DHCP, DNS, ...)")
|
||||
verbose_name_plural = _("services to generate (DHCP, DNS, ...)")
|
||||
|
||||
|
@ -2383,9 +2364,6 @@ class Service_link(RevMixin, AclMixin, models.Model):
|
|||
asked_regen = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_service_link", _("Can view a service server link object")),
|
||||
)
|
||||
verbose_name = _("link between service and server")
|
||||
verbose_name_plural = _("links between service and server")
|
||||
|
||||
|
@ -2438,9 +2416,6 @@ class OuverturePortList(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_ouvertureportlist", _("Can view a ports opening list" " object")),
|
||||
)
|
||||
verbose_name = _("ports opening list")
|
||||
verbose_name_plural = _("ports opening lists")
|
||||
|
||||
|
|
190
machines/urls.py
190
machines/urls.py
|
@ -26,142 +26,144 @@ The defined URLs for the Machines app
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
from . import views_autocomplete
|
||||
|
||||
app_name = "machines"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^new_machine/(?P<userid>[0-9]+)$", views.new_machine, name="new-machine"),
|
||||
url(
|
||||
r"^edit_interface/(?P<interfaceid>[0-9]+)$",
|
||||
path("new_machine/<int:userid>", views.new_machine, name="new-machine"),
|
||||
path(
|
||||
"edit_interface/<int:interfaceid>",
|
||||
views.edit_interface,
|
||||
name="edit-interface",
|
||||
),
|
||||
url(r"^del_machine/(?P<machineid>[0-9]+)$", views.del_machine, name="del-machine"),
|
||||
url(
|
||||
r"^new_interface/(?P<machineid>[0-9]+)$",
|
||||
path("del_machine/<int:machineid>", views.del_machine, name="del-machine"),
|
||||
path(
|
||||
"new_interface/<int:machineid>",
|
||||
views.new_interface,
|
||||
name="new-interface",
|
||||
),
|
||||
url(
|
||||
r"^del_interface/(?P<interfaceid>[0-9]+)$",
|
||||
path(
|
||||
"del_interface/<int:interfaceid>",
|
||||
views.del_interface,
|
||||
name="del-interface",
|
||||
),
|
||||
url(r"^add_machinetype/$", views.add_machinetype, name="add-machinetype"),
|
||||
url(
|
||||
r"^edit_machinetype/(?P<machinetypeid>[0-9]+)$",
|
||||
path("add_machinetype", views.add_machinetype, name="add-machinetype"),
|
||||
path(
|
||||
"edit_machinetype/<int:machinetypeid>",
|
||||
views.edit_machinetype,
|
||||
name="edit-machinetype",
|
||||
),
|
||||
url(r"^del_machinetype/$", views.del_machinetype, name="del-machinetype"),
|
||||
url(r"^index_machinetype/$", views.index_machinetype, name="index-machinetype"),
|
||||
url(r"^add_iptype/$", views.add_iptype, name="add-iptype"),
|
||||
url(r"^edit_iptype/(?P<iptypeid>[0-9]+)$", views.edit_iptype, name="edit-iptype"),
|
||||
url(r"^del_iptype/$", views.del_iptype, name="del-iptype"),
|
||||
url(r"^index_iptype/$", views.index_iptype, name="index-iptype"),
|
||||
url(r"^add_extension/$", views.add_extension, name="add-extension"),
|
||||
url(
|
||||
r"^edit_extension/(?P<extensionid>[0-9]+)$",
|
||||
path("del_machinetype", views.del_machinetype, name="del-machinetype"),
|
||||
path("index_machinetype", views.index_machinetype, name="index-machinetype"),
|
||||
path("add_iptype", views.add_iptype, name="add-iptype"),
|
||||
path("edit_iptype/<int:iptypeid>", views.edit_iptype, name="edit-iptype"),
|
||||
path("del_iptype", views.del_iptype, name="del-iptype"),
|
||||
path("index_iptype", views.index_iptype, name="index-iptype"),
|
||||
path("add_extension", views.add_extension, name="add-extension"),
|
||||
path(
|
||||
"edit_extension/<int:extensionid>",
|
||||
views.edit_extension,
|
||||
name="edit-extension",
|
||||
),
|
||||
url(r"^del_extension/$", views.del_extension, name="del-extension"),
|
||||
url(r"^add_soa/$", views.add_soa, name="add-soa"),
|
||||
url(r"^edit_soa/(?P<soaid>[0-9]+)$", views.edit_soa, name="edit-soa"),
|
||||
url(r"^del_soa/$", views.del_soa, name="del-soa"),
|
||||
url(r"^add_mx/$", views.add_mx, name="add-mx"),
|
||||
url(r"^edit_mx/(?P<mxid>[0-9]+)$", views.edit_mx, name="edit-mx"),
|
||||
url(r"^del_mx/$", views.del_mx, name="del-mx"),
|
||||
url(r"^add_txt/$", views.add_txt, name="add-txt"),
|
||||
url(r"^edit_txt/(?P<txtid>[0-9]+)$", views.edit_txt, name="edit-txt"),
|
||||
url(r"^del_txt/$", views.del_txt, name="del-txt"),
|
||||
url(r"^add_dname/$", views.add_dname, name="add-dname"),
|
||||
url(r"^edit_dname/(?P<dnameid>[0-9]+)$", views.edit_dname, name="edit-dname"),
|
||||
url(r"^del_dname/$", views.del_dname, name="del-dname"),
|
||||
url(r"^add_ns/$", views.add_ns, name="add-ns"),
|
||||
url(r"^edit_ns/(?P<nsid>[0-9]+)$", views.edit_ns, name="edit-ns"),
|
||||
url(r"^del_ns/$", views.del_ns, name="del-ns"),
|
||||
url(r"^add_srv/$", views.add_srv, name="add-srv"),
|
||||
url(r"^edit_srv/(?P<srvid>[0-9]+)$", views.edit_srv, name="edit-srv"),
|
||||
url(r"^del_srv/$", views.del_srv, name="del-srv"),
|
||||
url(r"^new_sshfp/(?P<machineid>[0-9]+)$", views.new_sshfp, name="new-sshfp"),
|
||||
url(r"^edit_sshfp/(?P<sshfpid>[0-9]+)$", views.edit_sshfp, name="edit-sshfp"),
|
||||
url(r"^del_sshfp/(?P<sshfpid>[0-9]+)$", views.del_sshfp, name="del-sshfp"),
|
||||
url(r"^index_sshfp/(?P<machineid>[0-9]+)$", views.index_sshfp, name="index-sshfp"),
|
||||
url(r"^index_extension/$", views.index_extension, name="index-extension"),
|
||||
url(r"^add_alias/(?P<interfaceid>[0-9]+)$", views.add_alias, name="add-alias"),
|
||||
url(r"^edit_alias/(?P<domainid>[0-9]+)$", views.edit_alias, name="edit-alias"),
|
||||
url(r"^del_alias/(?P<interfaceid>[0-9]+)$", views.del_alias, name="del-alias"),
|
||||
url(
|
||||
r"^index_alias/(?P<interfaceid>[0-9]+)$", views.index_alias, name="index-alias"
|
||||
path("del_extension", views.del_extension, name="del-extension"),
|
||||
path("add_soa", views.add_soa, name="add-soa"),
|
||||
path("edit_soa/<int:soaid>", views.edit_soa, name="edit-soa"),
|
||||
path("del_soa", views.del_soa, name="del-soa"),
|
||||
path("add_mx", views.add_mx, name="add-mx"),
|
||||
path("edit_mx/<int:mxid>", views.edit_mx, name="edit-mx"),
|
||||
path("del_mx", views.del_mx, name="del-mx"),
|
||||
path("add_txt", views.add_txt, name="add-txt"),
|
||||
path("edit_txt/<int:txtid>", views.edit_txt, name="edit-txt"),
|
||||
path("del_txt", views.del_txt, name="del-txt"),
|
||||
path("add_dname", views.add_dname, name="add-dname"),
|
||||
path("edit_dname/<int:dnameid>", views.edit_dname, name="edit-dname"),
|
||||
path("del_dname", views.del_dname, name="del-dname"),
|
||||
path("add_ns", views.add_ns, name="add-ns"),
|
||||
path("edit_ns/<int:nsid>", views.edit_ns, name="edit-ns"),
|
||||
path("del_ns", views.del_ns, name="del-ns"),
|
||||
path("add_srv", views.add_srv, name="add-srv"),
|
||||
path("edit_srv/<int:srvid>", views.edit_srv, name="edit-srv"),
|
||||
path("del_srv", views.del_srv, name="del-srv"),
|
||||
path("new_sshfp/<int:machineid>", views.new_sshfp, name="new-sshfp"),
|
||||
path("edit_sshfp/<int:sshfpid>", views.edit_sshfp, name="edit-sshfp"),
|
||||
path("del_sshfp/<int:sshfpid>", views.del_sshfp, name="del-sshfp"),
|
||||
path("index_sshfp/<int:machineid>", views.index_sshfp, name="index-sshfp"),
|
||||
path("index_extension", views.index_extension, name="index-extension"),
|
||||
path("add_alias/<int:interfaceid>", views.add_alias, name="add-alias"),
|
||||
path("edit_alias/<int:domainid>", views.edit_alias, name="edit-alias"),
|
||||
path("del_alias/<int:interfaceid>", views.del_alias, name="del-alias"),
|
||||
path(
|
||||
"index_alias/<int:interfaceid>", views.index_alias, name="index-alias"
|
||||
),
|
||||
url(
|
||||
r"^new_ipv6list/(?P<interfaceid>[0-9]+)$",
|
||||
path(
|
||||
"new_ipv6list/<int:interfaceid>",
|
||||
views.new_ipv6list,
|
||||
name="new-ipv6list",
|
||||
),
|
||||
url(
|
||||
r"^edit_ipv6list/(?P<ipv6listid>[0-9]+)$",
|
||||
path(
|
||||
"edit_ipv6list/<int:ipv6listid>",
|
||||
views.edit_ipv6list,
|
||||
name="edit-ipv6list",
|
||||
),
|
||||
url(
|
||||
r"^del_ipv6list/(?P<ipv6listid>[0-9]+)$",
|
||||
path(
|
||||
"del_ipv6list/<int:ipv6listid>",
|
||||
views.del_ipv6list,
|
||||
name="del-ipv6list",
|
||||
),
|
||||
url(r"^index_ipv6/(?P<interfaceid>[0-9]+)$", views.index_ipv6, name="index-ipv6"),
|
||||
url(r"^add_service/$", views.add_service, name="add-service"),
|
||||
url(
|
||||
r"^edit_service/(?P<serviceid>[0-9]+)$", views.edit_service, name="edit-service"
|
||||
path("index_ipv6/<int:interfaceid>", views.index_ipv6, name="index-ipv6"),
|
||||
path("add_service", views.add_service, name="add-service"),
|
||||
path(
|
||||
"edit_service/<int:serviceid>", views.edit_service, name="edit-service"
|
||||
),
|
||||
url(r"^del_service/$", views.del_service, name="del-service"),
|
||||
url(
|
||||
r"^regen_service/(?P<serviceid>[0-9]+)$",
|
||||
path("del_service", views.del_service, name="del-service"),
|
||||
path(
|
||||
"regen_service/<int:serviceid>",
|
||||
views.regen_service,
|
||||
name="regen-service",
|
||||
),
|
||||
url(r"^index_service/$", views.index_service, name="index-service"),
|
||||
url(r"^add_role/$", views.add_role, name="add-role"),
|
||||
url(r"^edit_role/(?P<roleid>[0-9]+)$", views.edit_role, name="edit-role"),
|
||||
url(r"^del_role/$", views.del_role, name="del-role"),
|
||||
url(r"^index_role/$", views.index_role, name="index-role"),
|
||||
url(r"^add_vlan/$", views.add_vlan, name="add-vlan"),
|
||||
url(r"^edit_vlan/(?P<vlanid>[0-9]+)$", views.edit_vlan, name="edit-vlan"),
|
||||
url(r"^del_vlan/$", views.del_vlan, name="del-vlan"),
|
||||
url(r"^index_vlan/$", views.index_vlan, name="index-vlan"),
|
||||
url(r"^add_nas/$", views.add_nas, name="add-nas"),
|
||||
url(r"^edit_nas/(?P<nasid>[0-9]+)$", views.edit_nas, name="edit-nas"),
|
||||
url(r"^del_nas/$", views.del_nas, name="del-nas"),
|
||||
url(r"^index_nas/$", views.index_nas, name="index-nas"),
|
||||
url(r"^$", views.index, name="index"),
|
||||
url(r"index_portlist/$", views.index_portlist, name="index-portlist"),
|
||||
url(
|
||||
r"^edit_portlist/(?P<ouvertureportlistid>[0-9]+)$",
|
||||
path("index_service", views.index_service, name="index-service"),
|
||||
path("add_role", views.add_role, name="add-role"),
|
||||
path("edit_role/<int:roleid>", views.edit_role, name="edit-role"),
|
||||
path("del_role", views.del_role, name="del-role"),
|
||||
path("index_role", views.index_role, name="index-role"),
|
||||
path("add_vlan", views.add_vlan, name="add-vlan"),
|
||||
path("edit_vlan/<int:vlanid>", views.edit_vlan, name="edit-vlan"),
|
||||
path("del_vlan", views.del_vlan, name="del-vlan"),
|
||||
path("index_vlan", views.index_vlan, name="index-vlan"),
|
||||
path("add_nas", views.add_nas, name="add-nas"),
|
||||
path("edit_nas/<int:nasid>", views.edit_nas, name="edit-nas"),
|
||||
path("del_nas", views.del_nas, name="del-nas"),
|
||||
path("index_nas", views.index_nas, name="index-nas"),
|
||||
path("", views.index, name="index"),
|
||||
path("index_portlist", views.index_portlist, name="index-portlist"),
|
||||
path(
|
||||
"edit_portlist/<int:ouvertureportlistid>",
|
||||
views.edit_portlist,
|
||||
name="edit-portlist",
|
||||
),
|
||||
url(
|
||||
r"^del_portlist/(?P<ouvertureportlistid>[0-9]+)$",
|
||||
path(
|
||||
"del_portlist/<int:ouvertureportlistid>",
|
||||
views.del_portlist,
|
||||
name="del-portlist",
|
||||
),
|
||||
url(r"^add_portlist/$", views.add_portlist, name="add-portlist"),
|
||||
url(
|
||||
r"^port_config/(?P<interfaceid>[0-9]+)$",
|
||||
path("add_portlist", views.add_portlist, name="add-portlist"),
|
||||
path(
|
||||
"port_config/<int:interfaceid>",
|
||||
views.configure_ports,
|
||||
name="port-config",
|
||||
),
|
||||
### Autocomplete Views
|
||||
url(r'^vlan-autocomplete/$', views_autocomplete.VlanAutocomplete.as_view(), name='vlan-autocomplete',),
|
||||
url(r'^interface-autocomplete/$', views_autocomplete.InterfaceAutocomplete.as_view(), name='interface-autocomplete',),
|
||||
url(r'^machine-autocomplete/$', views_autocomplete.MachineAutocomplete.as_view(), name='machine-autocomplete',),
|
||||
url(r'^machinetype-autocomplete/$', views_autocomplete.MachineTypeAutocomplete.as_view(), name='machinetype-autocomplete',),
|
||||
url(r'^iptype-autocomplete/$', views_autocomplete.IpTypeAutocomplete.as_view(), name='iptype-autocomplete',),
|
||||
url(r'^extension-autocomplete/$', views_autocomplete.ExtensionAutocomplete.as_view(), name='extension-autocomplete',),
|
||||
url(r'^domain-autocomplete/$', views_autocomplete.DomainAutocomplete.as_view(), name='domain-autocomplete',),
|
||||
url(r'^ouvertureportlist-autocomplete/$', views_autocomplete.OuverturePortListAutocomplete.as_view(), name='ouvertureportlist-autocomplete',),
|
||||
url(r'^iplist-autocomplete/$', views_autocomplete.IpListAutocomplete.as_view(), name='iplist-autocomplete',),
|
||||
path('vlan-autocomplete', views_autocomplete.VlanAutocomplete.as_view(), name='vlan-autocomplete',),
|
||||
path('interface-autocomplete', views_autocomplete.InterfaceAutocomplete.as_view(), name='interface-autocomplete',),
|
||||
path('machine-autocomplete', views_autocomplete.MachineAutocomplete.as_view(), name='machine-autocomplete',),
|
||||
path('machinetype-autocomplete', views_autocomplete.MachineTypeAutocomplete.as_view(), name='machinetype-autocomplete',),
|
||||
path('iptype-autocomplete', views_autocomplete.IpTypeAutocomplete.as_view(), name='iptype-autocomplete',),
|
||||
path('extension-autocomplete', views_autocomplete.ExtensionAutocomplete.as_view(), name='extension-autocomplete',),
|
||||
path('domain-autocomplete', views_autocomplete.DomainAutocomplete.as_view(), name='domain-autocomplete',),
|
||||
path('ouvertureportlist-autocomplete', views_autocomplete.OuverturePortListAutocomplete.as_view(), name='ouvertureportlist-autocomplete',),
|
||||
path('iplist-autocomplete', views_autocomplete.IpListAutocomplete.as_view(), name='iplist-autocomplete',),
|
||||
]
|
||||
|
|
|
@ -25,35 +25,37 @@ For further details on each of those models, see the documentation details for
|
|||
each.
|
||||
"""
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path, re_path
|
||||
|
||||
from . import views
|
||||
from .preferences.views import edit_options
|
||||
|
||||
app_name = "multi_op"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", views.aff_state_global, name="aff-state-global"),
|
||||
url(
|
||||
r"^(?P<dormitoryid>[0-9]+)$",
|
||||
path("", views.aff_state_global, name="aff-state-global"),
|
||||
path(
|
||||
"<int:dormitoryid>",
|
||||
views.aff_state_dormitory,
|
||||
name="aff-state-dormitory",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>MultiopOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
r"^pending-connection$",
|
||||
path(
|
||||
"pending-connection",
|
||||
views.aff_pending_connection,
|
||||
name="aff-pending-connection",
|
||||
),
|
||||
url(
|
||||
r"^pending-disconnection$",
|
||||
path(
|
||||
"pending-disconnection",
|
||||
views.aff_pending_disconnection,
|
||||
name="aff-pending-disconnection",
|
||||
),
|
||||
url(
|
||||
r"^disconnect-room/(?P<roomid>[0-9]+)$",
|
||||
path(
|
||||
"disconnect-room/<int:roomid>",
|
||||
views.disconnect_room,
|
||||
name="disconnect-room",
|
||||
),
|
||||
|
|
11
preferences/apps.py
Normal file
11
preferences/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of preferences app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PreferencesConfig(AppConfig):
|
||||
"""Configuration of preferences app."""
|
||||
|
||||
name = "preferences"
|
65
preferences/migrations/0003_auto_20210208_1827.py
Normal file
65
preferences/migrations/0003_auto_20210208_1827.py
Normal file
|
@ -0,0 +1,65 @@
|
|||
# Generated by Django 2.2.18 on 2021-02-08 17:27
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('preferences', '0002_foreign_keys'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='assooption',
|
||||
options={'verbose_name': 'organisation preferences'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='generaloption',
|
||||
options={'verbose_name': 'general preferences'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='homeoption',
|
||||
options={'verbose_name': 'homepage preferences'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='mailcontact',
|
||||
options={'verbose_name': 'contact email address', 'verbose_name_plural': 'contact email addresses'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='mailmessageoption',
|
||||
options={'verbose_name': 'email message preferences'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='mandate',
|
||||
options={'verbose_name': 'mandate', 'verbose_name_plural': 'mandates'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='optionalmachine',
|
||||
options={'verbose_name': 'machine preferences'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='optionaltopologie',
|
||||
options={'verbose_name': 'topology preferences'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='optionaluser',
|
||||
options={'verbose_name': 'user preferences'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='radiuskey',
|
||||
options={'verbose_name': 'RADIUS key', 'verbose_name_plural': 'RADIUS keys'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='reminder',
|
||||
options={'verbose_name': 'reminder', 'verbose_name_plural': 'reminders'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='service',
|
||||
options={'verbose_name': 'service', 'verbose_name_plural': 'services'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='switchmanagementcred',
|
||||
options={'verbose_name': 'switch management credentials'},
|
||||
),
|
||||
]
|
|
@ -185,7 +185,6 @@ class OptionalUser(AclMixin, PreferencesModel):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_optionaluser", _("Can view the user preferences")),)
|
||||
verbose_name = _("user preferences")
|
||||
|
||||
def clean(self):
|
||||
|
@ -241,7 +240,6 @@ class OptionalMachine(AclMixin, PreferencesModel):
|
|||
return not self.get_cached_value("ipv6_mode") == "DISABLED"
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_optionalmachine", _("Can view the machine preferences")),)
|
||||
verbose_name = _("machine preferences")
|
||||
|
||||
|
||||
|
@ -421,9 +419,6 @@ class OptionalTopologie(AclMixin, PreferencesModel):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_optionaltopologie", _("Can view the topology preferences")),
|
||||
)
|
||||
verbose_name = _("topology preferences")
|
||||
|
||||
|
||||
|
@ -453,7 +448,6 @@ class RadiusKey(AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_radiuskey", _("Can view a RADIUS key object")),)
|
||||
verbose_name = _("RADIUS key")
|
||||
verbose_name_plural = _("RADIUS keys")
|
||||
|
||||
|
@ -483,12 +477,6 @@ class SwitchManagementCred(AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
(
|
||||
"view_switchmanagementcred",
|
||||
_("Can view a switch management credentials object"),
|
||||
),
|
||||
)
|
||||
verbose_name = _("switch management credentials")
|
||||
|
||||
def __str__(self):
|
||||
|
@ -518,7 +506,6 @@ class Reminder(AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_reminder", _("Can view a reminder object")),)
|
||||
verbose_name = _("reminder")
|
||||
verbose_name_plural = _("reminders")
|
||||
|
||||
|
@ -582,7 +569,6 @@ class GeneralOption(AclMixin, PreferencesModel):
|
|||
GTU = models.FileField(upload_to="", default="", null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_generaloption", _("Can view the general preferences")),)
|
||||
verbose_name = _("general preferences")
|
||||
|
||||
|
||||
|
@ -609,7 +595,6 @@ class Service(AclMixin, models.Model):
|
|||
image = models.ImageField(upload_to="logo", blank=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_service", _("Can view the service preferences")),)
|
||||
verbose_name = _("service")
|
||||
verbose_name_plural = _("services")
|
||||
|
||||
|
@ -641,9 +626,6 @@ class MailContact(AclMixin, models.Model):
|
|||
return self.address.split("@")[0]
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_mailcontact", _("Can view a contact email address object")),
|
||||
)
|
||||
verbose_name = _("contact email address")
|
||||
verbose_name_plural = _("contact email addresses")
|
||||
|
||||
|
@ -664,7 +646,6 @@ class Mandate(RevMixin, AclMixin, models.Model):
|
|||
class Meta:
|
||||
verbose_name = _("mandate")
|
||||
verbose_name_plural = _("mandates")
|
||||
permissions = (("view_mandate", _("Can view a mandate object")),)
|
||||
|
||||
president = models.ForeignKey(
|
||||
"users.User",
|
||||
|
@ -740,7 +721,6 @@ class AssoOption(AclMixin, PreferencesModel):
|
|||
description = models.TextField(null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_assooption", _("Can view the organisation preferences")),)
|
||||
verbose_name = _("organisation preferences")
|
||||
|
||||
|
||||
|
@ -766,7 +746,6 @@ class HomeOption(AclMixin, PreferencesModel):
|
|||
twitter_account_name = models.CharField(max_length=32, null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_homeoption", _("Can view the homepage preferences")),)
|
||||
verbose_name = _("homepage preferences")
|
||||
|
||||
|
||||
|
@ -793,9 +772,6 @@ class MailMessageOption(AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_mailmessageoption", _("Can view the email message preferences")),
|
||||
)
|
||||
verbose_name = _("email message preferences")
|
||||
|
||||
|
||||
|
|
|
@ -25,139 +25,140 @@ Urls de l'application preferences, pointant vers les fonctions de views
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path, re_path
|
||||
|
||||
from . import views
|
||||
from .views import edit_options
|
||||
|
||||
app_name = "preferences"
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>OptionalUser)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>OptionalMachine)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>OptionalTopologie)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>GeneralOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>AssoOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>HomeOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>MailMessageOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>RadiusOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>CotisationsOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(r"^add_service/$", views.add_service, name="add-service"),
|
||||
url(
|
||||
r"^edit_service/(?P<serviceid>[0-9]+)$", views.edit_service, name="edit-service"
|
||||
path("add_service", views.add_service, name="add-service"),
|
||||
path(
|
||||
"edit_service/<int:serviceid>", views.edit_service, name="edit-service"
|
||||
),
|
||||
url(r"^del_service/(?P<serviceid>[0-9]+)$", views.del_service, name="del-service"),
|
||||
url(r"^add_mailcontact/$", views.add_mailcontact, name="add-mailcontact"),
|
||||
url(
|
||||
r"^edit_mailcontact/(?P<mailcontactid>[0-9]+)$",
|
||||
path("del_service/<int:serviceid>", views.del_service, name="del-service"),
|
||||
path("add_mailcontact", views.add_mailcontact, name="add-mailcontact"),
|
||||
path(
|
||||
"edit_mailcontact/<int:mailcontactid>",
|
||||
views.edit_mailcontact,
|
||||
name="edit-mailcontact",
|
||||
),
|
||||
url(r"^del_mailcontact/$", views.del_mailcontact, name="del-mailcontact"),
|
||||
url(r"^add_reminder/$", views.add_reminder, name="add-reminder"),
|
||||
url(
|
||||
r"^edit_reminder/(?P<reminderid>[0-9]+)$",
|
||||
path("del_mailcontact", views.del_mailcontact, name="del-mailcontact"),
|
||||
path("add_reminder", views.add_reminder, name="add-reminder"),
|
||||
path(
|
||||
"edit_reminder/<int:reminderid>",
|
||||
views.edit_reminder,
|
||||
name="edit-reminder",
|
||||
),
|
||||
url(
|
||||
r"^del_reminder/(?P<reminderid>[0-9]+)$",
|
||||
path(
|
||||
"del_reminder/<int:reminderid>",
|
||||
views.del_reminder,
|
||||
name="del-reminder",
|
||||
),
|
||||
url(r"^add_radiuskey/$", views.add_radiuskey, name="add-radiuskey"),
|
||||
url(
|
||||
r"^edit_radiuskey/(?P<radiuskeyid>[0-9]+)$",
|
||||
path("add_radiuskey", views.add_radiuskey, name="add-radiuskey"),
|
||||
path(
|
||||
"edit_radiuskey/<int:radiuskeyid>",
|
||||
views.edit_radiuskey,
|
||||
name="edit-radiuskey",
|
||||
),
|
||||
url(
|
||||
r"^del_radiuskey/(?P<radiuskeyid>[0-9]+)$",
|
||||
path(
|
||||
"del_radiuskey/<int:radiuskeyid>",
|
||||
views.del_radiuskey,
|
||||
name="del-radiuskey",
|
||||
),
|
||||
url(
|
||||
r"^add_switchmanagementcred/$",
|
||||
path(
|
||||
"add_switchmanagementcred",
|
||||
views.add_switchmanagementcred,
|
||||
name="add-switchmanagementcred",
|
||||
),
|
||||
url(
|
||||
r"^edit_switchmanagementcred/(?P<switchmanagementcredid>[0-9]+)$",
|
||||
path(
|
||||
"edit_switchmanagementcred/<int:switchmanagementcredid>",
|
||||
views.edit_switchmanagementcred,
|
||||
name="edit-switchmanagementcred",
|
||||
),
|
||||
url(
|
||||
r"^del_switchmanagementcred/(?P<switchmanagementcredid>[0-9]+)$",
|
||||
path(
|
||||
"del_switchmanagementcred/<int:switchmanagementcredid>",
|
||||
views.del_switchmanagementcred,
|
||||
name="del-switchmanagementcred",
|
||||
),
|
||||
url(
|
||||
r"^add_document_template/$",
|
||||
path(
|
||||
"add_document_template",
|
||||
views.add_document_template,
|
||||
name="add-document-template",
|
||||
),
|
||||
url(
|
||||
r"^edit_document_template/(?P<documenttemplateid>[0-9]+)$",
|
||||
path(
|
||||
"edit_document_template/<int:documenttemplateid>",
|
||||
views.edit_document_template,
|
||||
name="edit-document-template",
|
||||
),
|
||||
url(
|
||||
r"^del_document_template/$",
|
||||
path(
|
||||
"del_document_template",
|
||||
views.del_document_template,
|
||||
name="del-document-template",
|
||||
),
|
||||
url(r"^add_mandate/$", views.add_mandate, name="add-mandate"),
|
||||
url(
|
||||
r"^edit_mandate/(?P<mandateid>[0-9]+)$", views.edit_mandate, name="edit-mandate"
|
||||
path("add_mandate", views.add_mandate, name="add-mandate"),
|
||||
path(
|
||||
"edit_mandate/<int:mandateid>", views.edit_mandate, name="edit-mandate"
|
||||
),
|
||||
url(r"^del_mandate/(?P<mandateid>[0-9]+)$", views.del_mandate, name="del-mandate"),
|
||||
url(
|
||||
r"^add_radiusattribute/$", views.add_radiusattribute, name="add-radiusattribute"
|
||||
path("del_mandate/<int:mandateid>", views.del_mandate, name="del-mandate"),
|
||||
path(
|
||||
"add_radiusattribute", views.add_radiusattribute, name="add-radiusattribute"
|
||||
),
|
||||
url(
|
||||
r"^edit_radiusattribute/(?P<radiusattributeid>[0-9]+)$",
|
||||
path(
|
||||
"edit_radiusattribute/<int:radiusattributeid>",
|
||||
views.edit_radiusattribute,
|
||||
name="edit-radiusattribute",
|
||||
),
|
||||
url(
|
||||
r"^del_radiusattribute/(?P<radiusattributeid>[0-9]+)$",
|
||||
path(
|
||||
"del_radiusattribute/<int:radiusattributeid>",
|
||||
views.del_radiusattribute,
|
||||
name="del-radiusattribute",
|
||||
),
|
||||
url(r"^$", views.display_options, name="display-options"),
|
||||
path("", views.display_options, name="display-options"),
|
||||
]
|
||||
|
|
11
re2o/apps.py
Normal file
11
re2o/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of re2o app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class Re2oConfig(AppConfig):
|
||||
"""Configuration of re2o app."""
|
||||
|
||||
name = "re2o"
|
|
@ -53,7 +53,7 @@ def context_user(request):
|
|||
else:
|
||||
if global_message not in [msg.message for msg in get_messages(request._request)]:
|
||||
messages.warning(request._request, global_message)
|
||||
if user.is_authenticated():
|
||||
if user.is_authenticated:
|
||||
interfaces = user.user_interfaces()
|
||||
else:
|
||||
interfaces = None
|
||||
|
|
|
@ -283,9 +283,9 @@ class RecryptBackend(ModelBackend):
|
|||
|
||||
"""
|
||||
|
||||
def authenticate(self, username=None, password=None):
|
||||
def authenticate(self, request, username=None, password=None, **kwargs):
|
||||
# we obtain from the classical auth backend the user
|
||||
user = super(RecryptBackend, self).authenticate(None, username, password)
|
||||
user = super(RecryptBackend, self).authenticate(request, username, password, **kwargs)
|
||||
if user:
|
||||
if not (user.pwd_ntlm):
|
||||
# if we dont have NT hash, we create it
|
||||
|
|
|
@ -84,16 +84,15 @@ LOCAL_APPS = (
|
|||
INSTALLED_APPS = (
|
||||
EARLY_EXTERNAL_CONTRIB_APPS + DJANGO_CONTRIB_APPS + EXTERNAL_CONTRIB_APPS + LOCAL_APPS + OPTIONNAL_APPS
|
||||
)
|
||||
MIDDLEWARE_CLASSES = (
|
||||
MIDDLEWARE = (
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.locale.LocaleMiddleware",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
"django.middleware.csrf.CsrfViewMiddleware",
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"django.contrib.auth.middleware.SessionAuthenticationMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"reversion.middleware.RevisionMiddleware",
|
||||
)
|
||||
|
||||
|
@ -195,6 +194,21 @@ GRAPH_MODELS = {"all_applications": True, "group_models": True}
|
|||
# Timeout when sending emails through Django (in seconds)
|
||||
EMAIL_TIMEOUT = 10
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
},
|
||||
]
|
||||
|
||||
# Activate API
|
||||
if "api" in INSTALLED_APPS:
|
||||
from api.settings import *
|
||||
|
|
|
@ -382,7 +382,7 @@ class AclNode(Node):
|
|||
|
||||
def render(self, context):
|
||||
resolved_args = [arg.resolve(context) for arg in self.args]
|
||||
if context["user"].is_anonymous():
|
||||
if context["user"].is_anonymous:
|
||||
can = False
|
||||
else:
|
||||
can, _, _ = self.callback(context["user"], *(resolved_args))
|
||||
|
@ -407,7 +407,7 @@ class AclInstanceNode(Node):
|
|||
def render(self, context):
|
||||
callback = get_callback(self.tag_name, self.instance.resolve(context))
|
||||
resolved_args = [arg.resolve(context) for arg in self.args]
|
||||
if context["user"].is_anonymous():
|
||||
if context["user"].is_anonymous:
|
||||
can = False
|
||||
else:
|
||||
can, _, _ = callback(context["user"], *(resolved_args))
|
||||
|
|
62
re2o/urls.py
62
re2o/urls.py
|
@ -21,67 +21,47 @@
|
|||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
"""re2o URL Configuration
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/1.8/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: url(r'^$', views.home)
|
||||
3. Optional: Add a custom name for this URL:
|
||||
url(r'^$', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: url(r'^$', Home.as_view())
|
||||
3. Optional: Add a custom name for this URL:
|
||||
url(r'^$', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
||||
2. Optional: Add a custom namespace for all URL using this urlpatterns:
|
||||
url(r'^blog/', include('blog.urls'), namespace='blog')
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include, url
|
||||
from django.urls import include, path
|
||||
from django.contrib import admin
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic import RedirectView
|
||||
|
||||
from .settings_local import OPTIONNAL_APPS_RE2O
|
||||
|
||||
from .views import index, about_page, contact_page
|
||||
from .views import index, about_page, contact_page, handler404, handler500
|
||||
|
||||
# Admin site configuration
|
||||
admin.site.index_title = _("Homepage")
|
||||
admin.site.index_template = "admin/custom_index.html"
|
||||
|
||||
handler500 = "re2o.views.handler500"
|
||||
handler404 = "re2o.views.handler404"
|
||||
handler500 = handler500
|
||||
handler404 = handler404
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", index, name="index"),
|
||||
url(r"^about/$", about_page, name="about"),
|
||||
url(r"^contact/$", contact_page, name="contact"),
|
||||
url(r"^i18n/", include("django.conf.urls.i18n")),
|
||||
url(r"^users/", include("users.urls", namespace="users")),
|
||||
url(r"^search/", include("search.urls", namespace="search")),
|
||||
url(r"^cotisations/", include("cotisations.urls", namespace="cotisations")),
|
||||
url(r"^machines/", include("machines.urls", namespace="machines")),
|
||||
url(r"^topologie/", include("topologie.urls", namespace="topologie")),
|
||||
url(r"^logs/", include("logs.urls", namespace="logs")),
|
||||
url(r"^preferences/", include("preferences.urls", namespace="preferences")),
|
||||
path("", index, name="index"),
|
||||
path("about", about_page, name="about"),
|
||||
path("contact", contact_page, name="contact"),
|
||||
path("i18n/", include("django.conf.urls.i18n")),
|
||||
path("users/", include("users.urls", namespace="users")),
|
||||
path("search/", include("search.urls", namespace="search")),
|
||||
path("cotisations/", include("cotisations.urls", namespace="cotisations")),
|
||||
path("machines/", include("machines.urls", namespace="machines")),
|
||||
path("topologie/", include("topologie.urls", namespace="topologie")),
|
||||
path("logs/", include("logs.urls", namespace="logs")),
|
||||
path("preferences/", include("preferences.urls", namespace="preferences")),
|
||||
# Include contrib auth and contrib admin
|
||||
# manage/login/ is redirected to the non-admin login page
|
||||
url(r"^", include("django.contrib.auth.urls")),
|
||||
url(r"^admin/login/$", RedirectView.as_view(pattern_name="login")),
|
||||
url(r"^admin/", include(admin.site.urls)),
|
||||
path("", include("django.contrib.auth.urls")),
|
||||
path("admin/login/", RedirectView.as_view(pattern_name="login")),
|
||||
path("admin/", admin.site.urls),
|
||||
]
|
||||
|
||||
|
||||
urlpatterns += [
|
||||
url(r"^{}/".format(app), include("{}.urls".format(app), namespace=app))
|
||||
path("{}/".format(app), include("{}.urls".format(app), namespace=app))
|
||||
for app in OPTIONNAL_APPS_RE2O
|
||||
]
|
||||
|
||||
|
@ -89,6 +69,6 @@ urlpatterns += [
|
|||
if "debug_toolbar" in settings.INSTALLED_APPS:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns += [url(r"^__debug__/", include(debug_toolbar.urls))]
|
||||
urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]
|
||||
if "api" in settings.INSTALLED_APPS:
|
||||
urlpatterns += [url(r"^api/", include("api.urls", namespace="api"))]
|
||||
urlpatterns += [path("api/", include("api.urls", namespace="api"))]
|
||||
|
|
|
@ -168,7 +168,7 @@ def handler500(request):
|
|||
return render(request, "errors/500.html", status=500)
|
||||
|
||||
|
||||
def handler404(request):
|
||||
def handler404(request, exception):
|
||||
"""The handler view for a 404 error"""
|
||||
return render(request, "errors/404.html", status=404)
|
||||
|
||||
|
|
11
search/apps.py
Normal file
11
search/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of search app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class SearchConfig(AppConfig):
|
||||
"""Configuration of search app."""
|
||||
|
||||
name = "search"
|
|
@ -24,11 +24,13 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = "search"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", views.search, name="search"),
|
||||
url(r"^advanced/$", views.searchp, name="searchp"),
|
||||
path("", views.search, name="search"),
|
||||
path("advanced", views.searchp, name="searchp"),
|
||||
]
|
||||
|
|
|
@ -23,23 +23,25 @@
|
|||
Tickets url
|
||||
"""
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path, re_path
|
||||
|
||||
from . import views
|
||||
from .preferences.views import edit_options
|
||||
|
||||
app_name = "tickets"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", views.aff_tickets, name="aff-tickets"),
|
||||
url(r"^(?P<ticketid>[0-9]+)$", views.aff_ticket, name="aff-ticket"),
|
||||
url(r"^change_ticket_status/(?P<ticketid>[0-9]+)$", views.change_ticket_status, name="change-ticket-status"),
|
||||
url(r"^edit_ticket/(?P<ticketid>[0-9]+)$", views.edit_ticket, name="edit-ticket"),
|
||||
url(
|
||||
path("", views.aff_tickets, name="aff-tickets"),
|
||||
path("<int:ticketid>", views.aff_ticket, name="aff-ticket"),
|
||||
path("change_ticket_status/<int:ticketid>", views.change_ticket_status, name="change-ticket-status"),
|
||||
path("edit_ticket/<int:ticketid>", views.edit_ticket, name="edit-ticket"),
|
||||
re_path(
|
||||
r"^edit_options/(?P<section>TicketOption)$",
|
||||
edit_options,
|
||||
name="edit-options",
|
||||
),
|
||||
url(r"^new_ticket/$", views.new_ticket, name="new-ticket"),
|
||||
url(r"^add_comment/(?P<ticketid>[0-9]+)$", views.add_comment, name="add-comment"),
|
||||
url(r"^edit_comment/(?P<commentticketid>[0-9]+)$", views.edit_comment, name="edit-comment"),
|
||||
url(r"^del_comment/(?P<commentticketid>[0-9]+)$", views.del_comment, name="del-comment"),
|
||||
path("new_ticket", views.new_ticket, name="new-ticket"),
|
||||
path("add_comment/<int:ticketid>", views.add_comment, name="add-comment"),
|
||||
path("edit_comment/<int:commentticketid>", views.edit_comment, name="edit-comment"),
|
||||
path("del_comment/<int:commentticketid>", views.del_comment, name="del-comment"),
|
||||
]
|
||||
|
|
11
topologie/apps.py
Normal file
11
topologie/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of topologie app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class TopologieConfig(AppConfig):
|
||||
"""Configuration of topologie app."""
|
||||
|
||||
name = "topologie"
|
|
@ -52,12 +52,12 @@ class Migration(migrations.Migration):
|
|||
(
|
||||
"_content_type",
|
||||
models.ForeignKey(
|
||||
null=True, blank=True, to="contenttypes.ContentType"
|
||||
null=True, blank=True, to="contenttypes.ContentType", on_delete=models.CASCADE
|
||||
),
|
||||
),
|
||||
(
|
||||
"switch",
|
||||
models.ForeignKey(related_name="ports", to="topologie.Switch"),
|
||||
models.ForeignKey(related_name="ports", to="topologie.Switch", on_delete=models.CASCADE),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
71
topologie/migrations/0003_auto_20210208_1827.py
Normal file
71
topologie/migrations/0003_auto_20210208_1827.py
Normal file
|
@ -0,0 +1,71 @@
|
|||
# Generated by Django 2.2.18 on 2021-02-08 17:27
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('topologie', '0002_foreign_keys'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='accesspoint',
|
||||
options={'verbose_name': 'access point', 'verbose_name_plural': 'access points'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='building',
|
||||
options={'verbose_name': 'building', 'verbose_name_plural': 'buildings'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='constructorswitch',
|
||||
options={'verbose_name': 'switch constructor', 'verbose_name_plural': 'switch constructors'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='dormitory',
|
||||
options={'verbose_name': 'dormitory', 'verbose_name_plural': 'dormitories'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='modelswitch',
|
||||
options={'verbose_name': 'switch model', 'verbose_name_plural': 'switch models'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='moduleonswitch',
|
||||
options={'verbose_name': 'link between switch and module', 'verbose_name_plural': 'links between switch and module'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='moduleswitch',
|
||||
options={'verbose_name': 'switch module', 'verbose_name_plural': 'switch modules'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='port',
|
||||
options={'verbose_name': 'port', 'verbose_name_plural': 'ports'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='portprofile',
|
||||
options={'verbose_name': 'port profile', 'verbose_name_plural': 'port profiles'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='room',
|
||||
options={'ordering': ['building__name'], 'verbose_name': 'room', 'verbose_name_plural': 'rooms'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='stack',
|
||||
options={'verbose_name': 'switches stack', 'verbose_name_plural': 'switches stacks'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='switch',
|
||||
options={'verbose_name': 'switch', 'verbose_name_plural': 'switches'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='switchbay',
|
||||
options={'verbose_name': 'switch bay', 'verbose_name_plural': 'switch bays'},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='port',
|
||||
name='related',
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='related_port', to='topologie.Port'),
|
||||
),
|
||||
]
|
|
@ -35,7 +35,7 @@ class Migration(migrations.Migration):
|
|||
model_name="port",
|
||||
name="related",
|
||||
field=models.OneToOneField(
|
||||
null=True, to="topologie.Port", blank=True, related_name="related_port"
|
||||
null=True, to="topologie.Port", blank=True, related_name="related_port", on_delete=models.CASCADE
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
@ -36,7 +36,7 @@ class Migration(migrations.Migration):
|
|||
model_name="port",
|
||||
name="related",
|
||||
field=models.OneToOneField(
|
||||
blank=True, to="topologie.Port", related_name="related_port", null=True
|
||||
blank=True, to="topologie.Port", related_name="related_port", null=True, on_delete=models.CASCADE
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -43,7 +43,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name="switch",
|
||||
name="switch_interface",
|
||||
field=models.OneToOneField(default=1, to="machines.Interface"),
|
||||
field=models.OneToOneField(default=1, to="machines.Interface", on_delete=models.CASCADE),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterUniqueTogether(name="switch", unique_together=set([])),
|
||||
|
|
|
@ -70,7 +70,6 @@ class Stack(AclMixin, RevMixin, models.Model):
|
|||
member_id_max = models.PositiveIntegerField()
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_stack", _("Can view a stack object")),)
|
||||
verbose_name = _("switches stack")
|
||||
verbose_name_plural = _("switches stacks")
|
||||
|
||||
|
@ -106,7 +105,6 @@ class AccessPoint(Machine):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_accesspoint", _("Can view an access point object")),)
|
||||
verbose_name = _("access point")
|
||||
verbose_name_plural = _("access points")
|
||||
|
||||
|
@ -282,7 +280,6 @@ class Switch(Machine):
|
|||
|
||||
class Meta:
|
||||
unique_together = ("stack", "stack_member_id")
|
||||
permissions = (("view_switch", _("Can view a switch object")),)
|
||||
verbose_name = _("switch")
|
||||
verbose_name_plural = _("switches")
|
||||
|
||||
|
@ -590,7 +587,6 @@ class ModelSwitch(AclMixin, RevMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_modelswitch", _("Can view a switch model object")),)
|
||||
verbose_name = _("switch model")
|
||||
verbose_name_plural = _("switch models")
|
||||
|
||||
|
@ -623,7 +619,6 @@ class ModuleSwitch(AclMixin, RevMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_moduleswitch", _("Can view a switch module object")),)
|
||||
verbose_name = _("switch module")
|
||||
verbose_name_plural = _("switch modules")
|
||||
|
||||
|
@ -647,12 +642,6 @@ class ModuleOnSwitch(AclMixin, RevMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
(
|
||||
"view_moduleonswitch",
|
||||
_("Can view a link between switch and module object"),
|
||||
),
|
||||
)
|
||||
verbose_name = _("link between switch and module")
|
||||
verbose_name_plural = _("links between switch and module")
|
||||
unique_together = ["slot", "switch"]
|
||||
|
@ -673,9 +662,6 @@ class ConstructorSwitch(AclMixin, RevMixin, models.Model):
|
|||
name = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_constructorswitch", _("Can view a switch constructor object")),
|
||||
)
|
||||
verbose_name = _("switch constructor")
|
||||
verbose_name_plural = _("switch constructors")
|
||||
|
||||
|
@ -697,7 +683,6 @@ class SwitchBay(AclMixin, RevMixin, models.Model):
|
|||
info = models.CharField(max_length=255, blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_switchbay", _("Can view a switch bay object")),)
|
||||
verbose_name = _("switch bay")
|
||||
verbose_name_plural = _("switch bays")
|
||||
|
||||
|
@ -715,7 +700,6 @@ class Dormitory(AclMixin, RevMixin, models.Model):
|
|||
name = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_dormitory", _("Can view a dormitory object")),)
|
||||
verbose_name = _("dormitory")
|
||||
verbose_name_plural = _("dormitories")
|
||||
|
||||
|
@ -764,7 +748,6 @@ class Building(AclMixin, RevMixin, models.Model):
|
|||
dormitory = models.ForeignKey("Dormitory", on_delete=models.PROTECT)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_building", _("Can view a building object")),)
|
||||
verbose_name = _("building")
|
||||
verbose_name_plural = _("buildings")
|
||||
|
||||
|
@ -837,7 +820,7 @@ class Port(AclMixin, RevMixin, models.Model):
|
|||
"machines.Interface", on_delete=models.SET_NULL, blank=True, null=True
|
||||
)
|
||||
related = models.OneToOneField(
|
||||
"self", null=True, blank=True, related_name="related_port"
|
||||
"self", null=True, blank=True, related_name="related_port", on_delete=models.SET_NULL
|
||||
)
|
||||
custom_profile = models.ForeignKey(
|
||||
"PortProfile", on_delete=models.PROTECT, blank=True, null=True
|
||||
|
@ -851,7 +834,6 @@ class Port(AclMixin, RevMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
unique_together = ("switch", "port")
|
||||
permissions = (("view_port", _("Can view a port object")),)
|
||||
verbose_name = _("port")
|
||||
verbose_name_plural = _("ports")
|
||||
|
||||
|
@ -971,7 +953,6 @@ class Room(AclMixin, RevMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
ordering = ["building__name"]
|
||||
permissions = (("view_room", _("Can view a room object")),)
|
||||
verbose_name = _("room")
|
||||
verbose_name_plural = _("rooms")
|
||||
unique_together = ("name", "building")
|
||||
|
@ -1121,7 +1102,6 @@ class PortProfile(AclMixin, RevMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_portprofile", _("Can view a port profile object")),)
|
||||
verbose_name = _("port profile")
|
||||
verbose_name_plural = _("port profiles")
|
||||
unique_together = ["on_dormitory", "profil_default"]
|
||||
|
|
|
@ -25,157 +25,159 @@ The defined URLs for topologie app. Included in re2o.urls.
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
from . import views_autocomplete
|
||||
|
||||
app_name = "topologie"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", views.index, name="index"),
|
||||
url(r"^index_ap/$", views.index_ap, name="index-ap"),
|
||||
url(r"^new_ap/$", views.new_ap, name="new-ap"),
|
||||
url(r"^edit_ap/(?P<accesspointid>[0-9]+)$", views.edit_ap, name="edit-ap"),
|
||||
url(
|
||||
r"^create_ports/(?P<switchid>[0-9]+)$", views.create_ports, name="create-ports"
|
||||
path("", views.index, name="index"),
|
||||
path("index_ap", views.index_ap, name="index-ap"),
|
||||
path("new_ap", views.new_ap, name="new-ap"),
|
||||
path("edit_ap/<int:accesspointid>", views.edit_ap, name="edit-ap"),
|
||||
path(
|
||||
"create_ports/<int:switchid>", views.create_ports, name="create-ports"
|
||||
),
|
||||
url(r"^index_room/$", views.index_room, name="index-room"),
|
||||
url(r"^new_room/$", views.new_room, name="new-room"),
|
||||
url(r"^edit_room/(?P<roomid>[0-9]+)$", views.edit_room, name="edit-room"),
|
||||
url(r"^del_room/(?P<roomid>[0-9]+)$", views.del_room, name="del-room"),
|
||||
url(r"^new_switch/$", views.new_switch, name="new-switch"),
|
||||
url(r"^switch/(?P<switchid>[0-9]+)$", views.index_port, name="index-port"),
|
||||
url(r"^edit_port/(?P<portid>[0-9]+)$", views.edit_port, name="edit-port"),
|
||||
url(r"^new_port/(?P<switchid>[0-9]+)$", views.new_port, name="new-port"),
|
||||
url(r"^del_port/(?P<portid>[0-9]+)$", views.del_port, name="del-port"),
|
||||
url(r"^edit_switch/(?P<switchid>[0-9]+)$", views.edit_switch, name="edit-switch"),
|
||||
url(r"^new_stack/$", views.new_stack, name="new-stack"),
|
||||
url(
|
||||
r"^index_stack/$",
|
||||
path("index_room", views.index_room, name="index-room"),
|
||||
path("new_room", views.new_room, name="new-room"),
|
||||
path("edit_room/<int:roomid>", views.edit_room, name="edit-room"),
|
||||
path("del_room/<int:roomid>", views.del_room, name="del-room"),
|
||||
path("new_switch", views.new_switch, name="new-switch"),
|
||||
path("switch/<int:switchid>", views.index_port, name="index-port"),
|
||||
path("edit_port/<int:portid>", views.edit_port, name="edit-port"),
|
||||
path("new_port/<int:switchid>", views.new_port, name="new-port"),
|
||||
path("del_port/<int:portid>", views.del_port, name="del-port"),
|
||||
path("edit_switch/<int:switchid>", views.edit_switch, name="edit-switch"),
|
||||
path("new_stack", views.new_stack, name="new-stack"),
|
||||
path(
|
||||
"index_stack",
|
||||
views.index_stack,
|
||||
name="index-stack",
|
||||
),
|
||||
url(
|
||||
r"^index_switch_bay/$",
|
||||
path(
|
||||
"index_switch_bay",
|
||||
views.index_switch_bay,
|
||||
name="index-switch-bay",
|
||||
),
|
||||
url(
|
||||
r"^index_building/$",
|
||||
path(
|
||||
"index_building",
|
||||
views.index_building,
|
||||
name="index-building",
|
||||
),
|
||||
url(
|
||||
r"^index_dormitory/$",
|
||||
path(
|
||||
"index_dormitory",
|
||||
views.index_dormitory,
|
||||
name="index-dormitory",
|
||||
),
|
||||
url(r"^edit_stack/(?P<stackid>[0-9]+)$", views.edit_stack, name="edit-stack"),
|
||||
url(r"^del_stack/(?P<stackid>[0-9]+)$", views.del_stack, name="del-stack"),
|
||||
url(r"^index_model_switch/$", views.index_model_switch, name="index-model-switch"),
|
||||
url(r"^index_model_switch/$", views.index_model_switch, name="index-model-switch"),
|
||||
url(r"^new_model_switch/$", views.new_model_switch, name="new-model-switch"),
|
||||
url(
|
||||
r"^edit_model_switch/(?P<modelswitchid>[0-9]+)$",
|
||||
path("edit_stack/<int:stackid>", views.edit_stack, name="edit-stack"),
|
||||
path("del_stack/<int:stackid>", views.del_stack, name="del-stack"),
|
||||
path("index_model_switch", views.index_model_switch, name="index-model-switch"),
|
||||
path("index_model_switch", views.index_model_switch, name="index-model-switch"),
|
||||
path("new_model_switch", views.new_model_switch, name="new-model-switch"),
|
||||
path(
|
||||
"edit_model_switch/<int:modelswitchid>",
|
||||
views.edit_model_switch,
|
||||
name="edit-model-switch",
|
||||
),
|
||||
url(
|
||||
r"^del_model_switch/(?P<modelswitchid>[0-9]+)$",
|
||||
path(
|
||||
"del_model_switch/<int:modelswitchid>",
|
||||
views.del_model_switch,
|
||||
name="del-model-switch",
|
||||
),
|
||||
url(
|
||||
r"^new_constructor_switch/$",
|
||||
path(
|
||||
"new_constructor_switch",
|
||||
views.new_constructor_switch,
|
||||
name="new-constructor-switch",
|
||||
),
|
||||
url(
|
||||
r"^edit_constructor_switch/(?P<constructorswitchid>[0-9]+)$",
|
||||
path(
|
||||
"edit_constructor_switch/<int:constructorswitchid>",
|
||||
views.edit_constructor_switch,
|
||||
name="edit-constructor-switch",
|
||||
),
|
||||
url(
|
||||
r"^del_constructor_switch/(?P<constructorswitchid>[0-9]+)$",
|
||||
path(
|
||||
"del_constructor_switch/<int:constructorswitchid>",
|
||||
views.del_constructor_switch,
|
||||
name="del-constructor-switch",
|
||||
),
|
||||
url(r"^new_switch_bay/$", views.new_switch_bay, name="new-switch-bay"),
|
||||
url(
|
||||
r"^edit_switch_bay/(?P<switchbayid>[0-9]+)$",
|
||||
path("new_switch_bay", views.new_switch_bay, name="new-switch-bay"),
|
||||
path(
|
||||
"edit_switch_bay/<int:switchbayid>",
|
||||
views.edit_switch_bay,
|
||||
name="edit-switch-bay",
|
||||
),
|
||||
url(
|
||||
r"^del_switch_bay/(?P<switchbayid>[0-9]+)$",
|
||||
path(
|
||||
"del_switch_bay/<int:switchbayid>",
|
||||
views.del_switch_bay,
|
||||
name="del-switch-bay",
|
||||
),
|
||||
url(r"^new_building/$", views.new_building, name="new-building"),
|
||||
url(
|
||||
r"^edit_building/(?P<buildingid>[0-9]+)$",
|
||||
path("new_building", views.new_building, name="new-building"),
|
||||
path(
|
||||
"edit_building/<int:buildingid>",
|
||||
views.edit_building,
|
||||
name="edit-building",
|
||||
),
|
||||
url(
|
||||
r"^del_building/(?P<buildingid>[0-9]+)$",
|
||||
path(
|
||||
"del_building/<int:buildingid>",
|
||||
views.del_building,
|
||||
name="del-building",
|
||||
),
|
||||
url(r"^new_dormitory/$", views.new_dormitory, name="new-dormitory"),
|
||||
url(
|
||||
r"^edit_dormitory/(?P<dormitoryid>[0-9]+)$",
|
||||
path("new_dormitory", views.new_dormitory, name="new-dormitory"),
|
||||
path(
|
||||
"edit_dormitory/<int:dormitoryid>",
|
||||
views.edit_dormitory,
|
||||
name="edit-dormitory",
|
||||
),
|
||||
url(
|
||||
r"^del_dormitory/(?P<dormitoryid>[0-9]+)$",
|
||||
path(
|
||||
"del_dormitory/<int:dormitoryid>",
|
||||
views.del_dormitory,
|
||||
name="del-dormitory",
|
||||
),
|
||||
url(r"^index_port_profile/$", views.index_port_profile, name="index-port-profile"),
|
||||
url(r"^new_port_profile/$", views.new_port_profile, name="new-port-profile"),
|
||||
url(
|
||||
r"^edit_port_profile/(?P<portprofileid>[0-9]+)$",
|
||||
path("index_port_profile", views.index_port_profile, name="index-port-profile"),
|
||||
path("new_port_profile", views.new_port_profile, name="new-port-profile"),
|
||||
path(
|
||||
"edit_port_profile/<int:portprofileid>",
|
||||
views.edit_port_profile,
|
||||
name="edit-port-profile",
|
||||
),
|
||||
url(
|
||||
r"^del_port_profile/(?P<portprofileid>[0-9]+)$",
|
||||
path(
|
||||
"del_port_profile/<int:portprofileid>",
|
||||
views.del_port_profile,
|
||||
name="del-port-profile",
|
||||
),
|
||||
url(
|
||||
r"^edit_vlanoptions/(?P<vlanid>[0-9]+)$",
|
||||
path(
|
||||
"edit_vlanoptions/<int:vlanid>",
|
||||
views.edit_vlanoptions,
|
||||
name="edit-vlanoptions",
|
||||
),
|
||||
url(r"^add_module/$", views.add_module, name="add-module"),
|
||||
url(
|
||||
r"^edit_module/(?P<moduleswitchid>[0-9]+)$",
|
||||
path("add_module", views.add_module, name="add-module"),
|
||||
path(
|
||||
"edit_module/<int:moduleswitchid>",
|
||||
views.edit_module,
|
||||
name="edit-module",
|
||||
),
|
||||
url(
|
||||
r"^del_module/(?P<moduleswitchid>[0-9]+)$", views.del_module, name="del-module"
|
||||
path(
|
||||
"del_module/<int:moduleswitchid>", views.del_module, name="del-module"
|
||||
),
|
||||
url(r"^index_module/$", views.index_module, name="index-module"),
|
||||
url(r"^add_module_on/$", views.add_module_on, name="add-module-on"),
|
||||
url(
|
||||
r"^edit_module_on/(?P<moduleonswitchid>[0-9]+)$",
|
||||
path("index_module", views.index_module, name="index-module"),
|
||||
path("add_module_on", views.add_module_on, name="add-module-on"),
|
||||
path(
|
||||
"edit_module_on/<int:moduleonswitchid>",
|
||||
views.edit_module_on,
|
||||
name="edit-module-on",
|
||||
),
|
||||
url(
|
||||
r"^del_module_on/(?P<moduleonswitchid>[0-9]+)$",
|
||||
path(
|
||||
"del_module_on/<int:moduleonswitchid>",
|
||||
views.del_module_on,
|
||||
name="del-module-on",
|
||||
),
|
||||
### Autocomplete Views
|
||||
url(r'^room-autocomplete/$', views_autocomplete.RoomAutocomplete.as_view(), name='room-autocomplete',),
|
||||
url(r'^building-autocomplete/$', views_autocomplete.BuildingAutocomplete.as_view(), name='building-autocomplete',),
|
||||
url(r'^dormitory-autocomplete/$', views_autocomplete.DormitoryAutocomplete.as_view(), name='dormitory-autocomplete',),
|
||||
url(r'^switch-autocomplete/$', views_autocomplete.SwitchAutocomplete.as_view(), name='switch-autocomplete',),
|
||||
url(r'^port-autocomplete/$', views_autocomplete.PortAutocomplete.as_view(), name='profile-autocomplete',),
|
||||
url(r'^portprofile-autocomplete/$', views_autocomplete.PortProfileAutocomplete.as_view(), name='portprofile-autocomplete',),
|
||||
url(r'^switchbay-autocomplete/$', views_autocomplete.SwitchBayAutocomplete.as_view(), name='switchbay-autocomplete',),
|
||||
path('room-autocomplete', views_autocomplete.RoomAutocomplete.as_view(), name='room-autocomplete',),
|
||||
path('building-autocomplete', views_autocomplete.BuildingAutocomplete.as_view(), name='building-autocomplete',),
|
||||
path('dormitory-autocomplete', views_autocomplete.DormitoryAutocomplete.as_view(), name='dormitory-autocomplete',),
|
||||
path('switch-autocomplete', views_autocomplete.SwitchAutocomplete.as_view(), name='switch-autocomplete',),
|
||||
path('port-autocomplete', views_autocomplete.PortAutocomplete.as_view(), name='profile-autocomplete',),
|
||||
path('portprofile-autocomplete', views_autocomplete.PortProfileAutocomplete.as_view(), name='portprofile-autocomplete',),
|
||||
path('switchbay-autocomplete', views_autocomplete.SwitchBayAutocomplete.as_view(), name='switchbay-autocomplete',),
|
||||
]
|
||||
|
|
11
users/apps.py
Normal file
11
users/apps.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
"""
|
||||
Configuration of users app.
|
||||
"""
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CoreConfig(AppConfig):
|
||||
"""Configuration of users app."""
|
||||
|
||||
name = "users"
|
52
users/migrations/0003_auto_20210208_1827.py
Normal file
52
users/migrations/0003_auto_20210208_1827.py
Normal file
|
@ -0,0 +1,52 @@
|
|||
# Generated by Django 2.2.18 on 2021-02-08 17:27
|
||||
|
||||
import django.contrib.auth.models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0002_foreign_keys'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='ban',
|
||||
options={'verbose_name': 'ban', 'verbose_name_plural': 'bans'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='emailaddress',
|
||||
options={'verbose_name': 'local email account', 'verbose_name_plural': 'local email accounts'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='listright',
|
||||
options={'verbose_name': 'group of rights', 'verbose_name_plural': 'groups of rights'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='listshell',
|
||||
options={'verbose_name': 'shell', 'verbose_name_plural': 'shells'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='school',
|
||||
options={'verbose_name': 'school', 'verbose_name_plural': 'schools'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='serviceuser',
|
||||
options={'verbose_name': 'service user', 'verbose_name_plural': 'service users'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='user',
|
||||
options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_pseudo', 'Can edit the pseudo of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights')), 'verbose_name': 'user (member or club)', 'verbose_name_plural': 'users (members or clubs)'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='whitelist',
|
||||
options={'verbose_name': 'whitelist (free of charge access)', 'verbose_name_plural': 'whitelists (free of charge access)'},
|
||||
),
|
||||
migrations.AlterModelManagers(
|
||||
name='listright',
|
||||
managers=[
|
||||
('objects', django.contrib.auth.models.GroupManager()),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -57,7 +57,7 @@ from django.db.models.signals import post_save, post_delete, m2m_changed
|
|||
from django.dispatch import receiver
|
||||
from django.utils.functional import cached_property
|
||||
from django.template import loader
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.db import transaction
|
||||
from django.utils import timezone
|
||||
from datetime import timedelta
|
||||
|
@ -319,7 +319,6 @@ class User(
|
|||
_("Can edit the groups of rights of a user (critical permission)"),
|
||||
),
|
||||
("change_all_users", _("Can edit all users, including those with rights")),
|
||||
("view_user", _("Can view a user object")),
|
||||
)
|
||||
verbose_name = _("user (member or club)")
|
||||
verbose_name_plural = _("users (members or clubs)")
|
||||
|
@ -2161,7 +2160,6 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser):
|
|||
objects = UserManager()
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_serviceuser", _("Can view a service user object")),)
|
||||
verbose_name = _("service user")
|
||||
verbose_name_plural = _("service users")
|
||||
|
||||
|
@ -2218,7 +2216,6 @@ class School(RevMixin, AclMixin, models.Model):
|
|||
name = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_school", _("Can view a school object")),)
|
||||
verbose_name = _("school")
|
||||
verbose_name_plural = _("schools")
|
||||
|
||||
|
@ -2272,7 +2269,6 @@ class ListRight(RevMixin, AclMixin, Group):
|
|||
details = models.CharField(help_text=_("Description."), max_length=255, blank=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_listright", _("Can view a group of rights object")),)
|
||||
verbose_name = _("group of rights")
|
||||
verbose_name_plural = _("groups of rights")
|
||||
|
||||
|
@ -2312,7 +2308,6 @@ class ListShell(RevMixin, AclMixin, models.Model):
|
|||
shell = models.CharField(max_length=255, unique=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_listshell", _("Can view a shell object")),)
|
||||
verbose_name = _("shell")
|
||||
verbose_name_plural = _("shells")
|
||||
|
||||
|
@ -2378,7 +2373,6 @@ class Ban(RevMixin, AclMixin, models.Model):
|
|||
request = None
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_ban", _("Can view a ban object")),)
|
||||
verbose_name = _("ban")
|
||||
verbose_name_plural = _("bans")
|
||||
|
||||
|
@ -2495,7 +2489,6 @@ class Whitelist(RevMixin, AclMixin, models.Model):
|
|||
date_end = models.DateTimeField()
|
||||
|
||||
class Meta:
|
||||
permissions = (("view_whitelist", _("Can view a whitelist object")),)
|
||||
verbose_name = _("whitelist (free of charge access)")
|
||||
verbose_name_plural = _("whitelists (free of charge access)")
|
||||
|
||||
|
@ -2617,9 +2610,6 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_emailaddress", _("Can view a local email account object")),
|
||||
)
|
||||
verbose_name = _("local email account")
|
||||
verbose_name_plural = _("local email accounts")
|
||||
|
||||
|
|
134
users/urls.py
134
users/urls.py
|
@ -28,111 +28,113 @@ The defined URLs for the Users app
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import path, re_path
|
||||
|
||||
from . import views
|
||||
from . import views_autocomplete
|
||||
|
||||
app_name = "users"
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^new_user/$", views.new_user, name="new-user"),
|
||||
url(r"^new_club/$", views.new_club, name="new-club"),
|
||||
url(r"^edit_info/(?P<userid>[0-9]+)$", views.edit_info, name="edit-info"),
|
||||
url(
|
||||
r"^edit_club_admin_members/(?P<clubid>[0-9]+)$",
|
||||
path("new_user", views.new_user, name="new-user"),
|
||||
path("new_club", views.new_club, name="new-club"),
|
||||
path("edit_info/<int:userid>", views.edit_info, name="edit-info"),
|
||||
path(
|
||||
"edit_club_admin_members/<int:clubid>",
|
||||
views.edit_club_admin_members,
|
||||
name="edit-club-admin-members",
|
||||
),
|
||||
url(r"^state/(?P<userid>[0-9]+)$", views.state, name="state"),
|
||||
url(r"^groups/(?P<userid>[0-9]+)$", views.groups, name="groups"),
|
||||
url(r"^password/(?P<userid>[0-9]+)$", views.password, name="password"),
|
||||
url(r"^confirm_email/(?P<userid>[0-9]+)$", views.resend_confirmation_email, name="resend-confirmation-email"),
|
||||
url(
|
||||
r"^del_group/(?P<userid>[0-9]+)/(?P<listrightid>[0-9]+)$",
|
||||
path("state/<int:userid>", views.state, name="state"),
|
||||
path("groups/<int:userid>", views.groups, name="groups"),
|
||||
path("password/<int:userid>", views.password, name="password"),
|
||||
path("confirm_email/<int:userid>", views.resend_confirmation_email, name="resend-confirmation-email"),
|
||||
path(
|
||||
"del_group/<int:userid>/<int:listrightid>",
|
||||
views.del_group,
|
||||
name="del-group",
|
||||
),
|
||||
url(
|
||||
r"^del_superuser/(?P<userid>[0-9]+)$", views.del_superuser, name="del-superuser"
|
||||
path(
|
||||
"del_superuser/<int:userid>", views.del_superuser, name="del-superuser"
|
||||
),
|
||||
url(r"^new_serviceuser/$", views.new_serviceuser, name="new-serviceuser"),
|
||||
url(
|
||||
r"^edit_serviceuser/(?P<serviceuserid>[0-9]+)$",
|
||||
path("new_serviceuser", views.new_serviceuser, name="new-serviceuser"),
|
||||
path(
|
||||
"edit_serviceuser/<int:serviceuserid>",
|
||||
views.edit_serviceuser,
|
||||
name="edit-serviceuser",
|
||||
),
|
||||
url(
|
||||
r"^del_serviceuser/(?P<serviceuserid>[0-9]+)$",
|
||||
path(
|
||||
"del_serviceuser/<int:serviceuserid>",
|
||||
views.del_serviceuser,
|
||||
name="del-serviceuser",
|
||||
),
|
||||
url(r"^add_ban/(?P<userid>[0-9]+)$", views.add_ban, name="add-ban"),
|
||||
url(r"^edit_ban/(?P<banid>[0-9]+)$", views.edit_ban, name="edit-ban"),
|
||||
url(r"^del-ban/(?P<banid>[0-9]+)$", views.del_ban, name="del-ban"),
|
||||
url(
|
||||
r"^add_whitelist/(?P<userid>[0-9]+)$", views.add_whitelist, name="add-whitelist"
|
||||
path("add_ban/<int:userid>", views.add_ban, name="add-ban"),
|
||||
path("edit_ban/<int:banid>", views.edit_ban, name="edit-ban"),
|
||||
path("del-ban/<int:banid>", views.del_ban, name="del-ban"),
|
||||
path(
|
||||
"add_whitelist/<int:userid>", views.add_whitelist, name="add-whitelist"
|
||||
),
|
||||
url(
|
||||
r"^edit_whitelist/(?P<whitelistid>[0-9]+)$",
|
||||
path(
|
||||
"edit_whitelist/<int:whitelistid>",
|
||||
views.edit_whitelist,
|
||||
name="edit-whitelist",
|
||||
),
|
||||
url(
|
||||
r"^del_whitelist/(?P<whitelistid>[0-9]+)$",
|
||||
path(
|
||||
"del_whitelist/<int:whitelistid>",
|
||||
views.del_whitelist,
|
||||
name="del-whitelist",
|
||||
),
|
||||
url(
|
||||
r"^add_emailaddress/(?P<userid>[0-9]+)$",
|
||||
path(
|
||||
"add_emailaddress/<int:userid>",
|
||||
views.add_emailaddress,
|
||||
name="add-emailaddress",
|
||||
),
|
||||
url(
|
||||
r"^edit_emailaddress/(?P<emailaddressid>[0-9]+)$",
|
||||
path(
|
||||
"edit_emailaddress/<int:emailaddressid>",
|
||||
views.edit_emailaddress,
|
||||
name="edit-emailaddress",
|
||||
),
|
||||
url(
|
||||
r"^del_emailaddress/(?P<emailaddressid>[0-9]+)$",
|
||||
path(
|
||||
"del_emailaddress/<int:emailaddressid>",
|
||||
views.del_emailaddress,
|
||||
name="del-emailaddress",
|
||||
),
|
||||
url(
|
||||
r"^edit_email_settings/(?P<userid>[0-9]+)$",
|
||||
path(
|
||||
"edit_email_settings/<int:userid>",
|
||||
views.edit_email_settings,
|
||||
name="edit-email-settings",
|
||||
),
|
||||
url(r"^add_school/$", views.add_school, name="add-school"),
|
||||
url(r"^edit_school/(?P<schoolid>[0-9]+)$", views.edit_school, name="edit-school"),
|
||||
url(r"^del_school/$", views.del_school, name="del-school"),
|
||||
url(r"^add_listright/$", views.add_listright, name="add-listright"),
|
||||
url(
|
||||
r"^edit_listright/(?P<listrightid>[0-9]+)$",
|
||||
path("add_school", views.add_school, name="add-school"),
|
||||
path("edit_school/<int:schoolid>", views.edit_school, name="edit-school"),
|
||||
path("del_school", views.del_school, name="del-school"),
|
||||
path("add_listright", views.add_listright, name="add-listright"),
|
||||
path(
|
||||
"edit_listright/<int:listrightid>",
|
||||
views.edit_listright,
|
||||
name="edit-listright",
|
||||
),
|
||||
url(r"^del_listright/$", views.del_listright, name="del-listright"),
|
||||
url(r"^add_shell/$", views.add_shell, name="add-shell"),
|
||||
url(r"^edit_shell/(?P<listshellid>[0-9]+)$", views.edit_shell, name="edit-shell"),
|
||||
url(r"^del_shell/(?P<listshellid>[0-9]+)$", views.del_shell, name="del-shell"),
|
||||
url(r"^profil/(?P<userid>[0-9]+)$", views.profil, name="profil"),
|
||||
url(r"^index_ban/$", views.index_ban, name="index-ban"),
|
||||
url(r"^index_white/$", views.index_white, name="index-white"),
|
||||
url(r"^index_school/$", views.index_school, name="index-school"),
|
||||
url(r"^index_shell/$", views.index_shell, name="index-shell"),
|
||||
url(r"^index_listright/$", views.index_listright, name="index-listright"),
|
||||
url(r"^index_serviceusers/$", views.index_serviceusers, name="index-serviceusers"),
|
||||
url(r"^mon_profil/$", views.mon_profil, name="mon-profil"),
|
||||
url(r"^process/(?P<token>[a-z0-9]{32})/$", views.process, name="process"),
|
||||
url(r"^reset_password/$", views.reset_password, name="reset-password"),
|
||||
url(r"^mass_archive/$", views.mass_archive, name="mass-archive"),
|
||||
url(r"^$", views.index, name="index"),
|
||||
url(r"^index_clubs/$", views.index_clubs, name="index-clubs"),
|
||||
url(r"^initial_register/$", views.initial_register, name="initial-register"),
|
||||
url(r"^edit_theme/(?P<userid>[0-9]+)$", views.edit_theme, name="edit-theme"),
|
||||
path("del_listright", views.del_listright, name="del-listright"),
|
||||
path("add_shell", views.add_shell, name="add-shell"),
|
||||
path("edit_shell/<int:listshellid>", views.edit_shell, name="edit-shell"),
|
||||
path("del_shell/<int:listshellid>", views.del_shell, name="del-shell"),
|
||||
path("profil/<int:userid>", views.profil, name="profil"),
|
||||
path("index_ban", views.index_ban, name="index-ban"),
|
||||
path("index_white", views.index_white, name="index-white"),
|
||||
path("index_school", views.index_school, name="index-school"),
|
||||
path("index_shell", views.index_shell, name="index-shell"),
|
||||
path("index_listright", views.index_listright, name="index-listright"),
|
||||
path("index_serviceusers", views.index_serviceusers, name="index-serviceusers"),
|
||||
path("mon_profil", views.mon_profil, name="mon-profil"),
|
||||
re_path(r"^process/(?P<token>[a-z0-9]{32})/$", views.process, name="process"),
|
||||
path("reset_password", views.reset_password, name="reset-password"),
|
||||
path("mass_archive", views.mass_archive, name="mass-archive"),
|
||||
path("", views.index, name="index"),
|
||||
path("index_clubs", views.index_clubs, name="index-clubs"),
|
||||
path("initial_register", views.initial_register, name="initial-register"),
|
||||
path("edit_theme/<int:userid>", views.edit_theme, name="edit-theme"),
|
||||
### Autocomplete Views
|
||||
url(r'^user-autocomplete/$', views_autocomplete.UserAutocomplete.as_view(), name='user-autocomplete',),
|
||||
url(r'^adherent-autocomplete/$', views_autocomplete.AdherentAutocomplete.as_view(), name='adherent-autocomplete',),
|
||||
url(r'^club-autocomplete/$', views_autocomplete.ClubAutocomplete.as_view(), name='club-autocomplete',),
|
||||
url(r'^school-autocomplete/$', views_autocomplete.SchoolAutocomplete.as_view(), name='school-autocomplete',),
|
||||
url(r'^shell-autocomplete/$', views_autocomplete.ShellAutocomplete.as_view(), name='shell-autocomplete',),
|
||||
path('user-autocomplete', views_autocomplete.UserAutocomplete.as_view(), name='user-autocomplete',),
|
||||
path('adherent-autocomplete', views_autocomplete.AdherentAutocomplete.as_view(), name='adherent-autocomplete',),
|
||||
path('club-autocomplete', views_autocomplete.ClubAutocomplete.as_view(), name='club-autocomplete',),
|
||||
path('school-autocomplete', views_autocomplete.SchoolAutocomplete.as_view(), name='school-autocomplete',),
|
||||
path('shell-autocomplete', views_autocomplete.ShellAutocomplete.as_view(), name='shell-autocomplete',),
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue