1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files
Stefan Pratter d5c3429254 Support 202206 (#1207)
* Organization Merging Tool only offers the first 10 matches #941

* AC Change User Permission broken #1043

* change rs peer icon and move to policy column (#727)

* An account with admin status can not have permissions #1157

* add rir_* fields to keep track of ASN status #473

* poetry relock for rdap 1.3.0

* Ops: Limit Django session creation for unauthenticated requests (#1205)

* refactor 941 changes to honor grappelli field configuration and also fix broken end anchors

* check term has a value

* fix tests

* poetry reloc and pin django-peeringdb to 2.14.0

* fix middleware test

* linting

* set more reasonable default RIR_ALLOCATION_DATA_CACHE_DAYS

* better default dir for RIR_ALLOCATION_DATA_PATH

* fix csv export for advanced search

* fix issues with tests failing on CSRF_USE_SESSIONS when they are using RequestFactory

* tox.ini for flake8 options

* regen docs

* regen docs

Co-authored-by: David Poarch <dpoarch@20c.com>
2022-07-15 13:47:59 -05:00

73 lines
2.2 KiB
Python

from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
# auto admin
from django.contrib import admin
from django.views.generic.base import RedirectView
from two_factor.urls import urlpatterns as tf_urls
from peeringdb_server.views import LoginView, TwoFactorDisableView
admin.autodiscover()
import allauth.account.views
import peeringdb_server.urls
from peeringdb_server.autocomplete_views import GrappelliHandlerefAutocomplete
tf_urls[0][0] = url(
regex=r"^account/login/$",
view=LoginView.as_view(),
name="login",
)
tf_urls[0][-1] = url(
regex=r"^account/disable-2fa/$",
view=TwoFactorDisableView.as_view(),
name="disable",
)
urlpatterns = [
# override grappelli autocomplete handler
url(
r"^grappelli/lookup/autocomplete/$",
GrappelliHandlerefAutocomplete.as_view(),
name="grp_autocomplete_lookup",
),
# grappelli admin interface improvements
url(r"^grappelli/", include("grappelli.urls")),
# FIXME: adapt to DAL3 changes
# url(r'^autocomplete/', include('dal.urls')),
# FIXME: can remove this if we upgrade to allauth > 0.24.2, upgrade
# has been held off at this point because it requires migrations
url(
r"^accounts/confirm-email/(?P<key>[-:\w]+)/$",
allauth.account.views.confirm_email,
name="account_confirm_email",
),
url(r"^accounts/", include("allauth.urls")),
url(
r"^cp/peeringdb_server/organizationmerge/add/",
RedirectView.as_view(
url="/cp/peeringdb_server/organization/org-merge-tool", permanent=False
),
),
url(r"^cp/", admin.site.urls),
url(r"", include(tf_urls)),
]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += [
url(r"^captcha/", include("captcha.urls")),
]
urlpatterns += peeringdb_server.urls.urlpatterns
# append the login view again,so the name is available for reverse lookups
urlpatterns += [tf_urls[0][0]]
handler_404 = "peeringdb_server.views.view_http_error_404"
handler_403 = "peeringdb_server.views.view_http_error_403"