mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Merge v2.5.11
This commit is contained in:
commit
37c2c4b4a2
22
CHANGELOG.md
22
CHANGELOG.md
@ -195,6 +195,28 @@ functionality provided by the front end UI.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
2.5.11 (2019-04-29)
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
This release upgrades the Django framework to version 2.2.
|
||||||
|
|
||||||
|
## Enhancements
|
||||||
|
|
||||||
|
* [#2986](https://github.com/digitalocean/netbox/issues/2986) - Improve natural ordering of device components
|
||||||
|
* [#3023](https://github.com/digitalocean/netbox/issues/3023) - Add support for filtering cables by connected device
|
||||||
|
* [#3070](https://github.com/digitalocean/netbox/issues/3070) - Add decommissioning status for devices
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
|
||||||
|
* [#2621](https://github.com/digitalocean/netbox/issues/2621) - Upgrade Django requirement to 2.2 to fix object deletion issue in the changelog middleware
|
||||||
|
* [#3072](https://github.com/digitalocean/netbox/issues/3072) - Preserve multiselect filter values when updating per-page count for list views
|
||||||
|
* [#3112](https://github.com/digitalocean/netbox/issues/3112) - Fix ordering of interface connections list by termination B name/device
|
||||||
|
* [#3116](https://github.com/digitalocean/netbox/issues/3116) - Fix `tagged_items` count in tags API endpoint
|
||||||
|
* [#3118](https://github.com/digitalocean/netbox/issues/3118) - Disable `last_login` update on login when maintenance mode is enabled
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
v2.5.10 (2019-04-08)
|
v2.5.10 (2019-04-08)
|
||||||
|
|
||||||
## Enhancements
|
## Enhancements
|
||||||
|
@ -318,6 +318,7 @@ DEVICE_STATUS_PLANNED = 2
|
|||||||
DEVICE_STATUS_STAGED = 3
|
DEVICE_STATUS_STAGED = 3
|
||||||
DEVICE_STATUS_FAILED = 4
|
DEVICE_STATUS_FAILED = 4
|
||||||
DEVICE_STATUS_INVENTORY = 5
|
DEVICE_STATUS_INVENTORY = 5
|
||||||
|
DEVICE_STATUS_DECOMMISSIONING = 6
|
||||||
DEVICE_STATUS_CHOICES = [
|
DEVICE_STATUS_CHOICES = [
|
||||||
[DEVICE_STATUS_ACTIVE, 'Active'],
|
[DEVICE_STATUS_ACTIVE, 'Active'],
|
||||||
[DEVICE_STATUS_OFFLINE, 'Offline'],
|
[DEVICE_STATUS_OFFLINE, 'Offline'],
|
||||||
@ -325,6 +326,7 @@ DEVICE_STATUS_CHOICES = [
|
|||||||
[DEVICE_STATUS_STAGED, 'Staged'],
|
[DEVICE_STATUS_STAGED, 'Staged'],
|
||||||
[DEVICE_STATUS_FAILED, 'Failed'],
|
[DEVICE_STATUS_FAILED, 'Failed'],
|
||||||
[DEVICE_STATUS_INVENTORY, 'Inventory'],
|
[DEVICE_STATUS_INVENTORY, 'Inventory'],
|
||||||
|
[DEVICE_STATUS_DECOMMISSIONING, 'Decommissioning'],
|
||||||
]
|
]
|
||||||
|
|
||||||
# Site statuses
|
# Site statuses
|
||||||
@ -345,6 +347,7 @@ STATUS_CLASSES = {
|
|||||||
3: 'primary',
|
3: 'primary',
|
||||||
4: 'danger',
|
4: 'danger',
|
||||||
5: 'default',
|
5: 'default',
|
||||||
|
6: 'warning',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Console/power/interface connection statuses
|
# Console/power/interface connection statuses
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import django_filters
|
import django_filters
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from netaddr import EUI
|
from netaddr import EUI
|
||||||
from netaddr.core import AddrFormatError
|
from netaddr.core import AddrFormatError
|
||||||
@ -969,6 +971,14 @@ class CableFilter(django_filters.FilterSet):
|
|||||||
color = django_filters.MultipleChoiceFilter(
|
color = django_filters.MultipleChoiceFilter(
|
||||||
choices=COLOR_CHOICES
|
choices=COLOR_CHOICES
|
||||||
)
|
)
|
||||||
|
device = django_filters.CharFilter(
|
||||||
|
method='filter_connected_device',
|
||||||
|
field_name='name'
|
||||||
|
)
|
||||||
|
device_id = django_filters.CharFilter(
|
||||||
|
method='filter_connected_device',
|
||||||
|
field_name='pk'
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Cable
|
model = Cable
|
||||||
@ -979,6 +989,16 @@ class CableFilter(django_filters.FilterSet):
|
|||||||
return queryset
|
return queryset
|
||||||
return queryset.filter(label__icontains=value)
|
return queryset.filter(label__icontains=value)
|
||||||
|
|
||||||
|
def filter_connected_device(self, queryset, name, value):
|
||||||
|
if not value.strip():
|
||||||
|
return queryset
|
||||||
|
try:
|
||||||
|
device = Device.objects.get(**{name: value})
|
||||||
|
except ObjectDoesNotExist:
|
||||||
|
return queryset.none()
|
||||||
|
cable_pks = device.get_cables(pk_list=True)
|
||||||
|
return queryset.filter(pk__in=cable_pks)
|
||||||
|
|
||||||
|
|
||||||
class ConsoleConnectionFilter(django_filters.FilterSet):
|
class ConsoleConnectionFilter(django_filters.FilterSet):
|
||||||
site = django_filters.CharFilter(
|
site = django_filters.CharFilter(
|
||||||
|
@ -3003,6 +3003,10 @@ class CableFilterForm(BootstrapMixin, forms.Form):
|
|||||||
required=False,
|
required=False,
|
||||||
widget=ColorSelect()
|
widget=ColorSelect()
|
||||||
)
|
)
|
||||||
|
device = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
label='Device name'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -14,22 +14,6 @@ CHANNEL_RE = r"COALESCE(CAST(SUBSTRING({} FROM '^.*:(\d{{1,9}})(\.\d{{1,9}})?$')
|
|||||||
VC_RE = r"COALESCE(CAST(SUBSTRING({} FROM '^.*\.(\d{{1,9}})$') AS integer), 0)"
|
VC_RE = r"COALESCE(CAST(SUBSTRING({} FROM '^.*\.(\d{{1,9}})$') AS integer), 0)"
|
||||||
|
|
||||||
|
|
||||||
class DeviceComponentManager(Manager):
|
|
||||||
|
|
||||||
def get_queryset(self):
|
|
||||||
|
|
||||||
queryset = super().get_queryset()
|
|
||||||
table_name = self.model._meta.db_table
|
|
||||||
sql = r"CONCAT(REGEXP_REPLACE({}.name, '\d+$', ''), LPAD(SUBSTRING({}.name FROM '\d+$'), 8, '0'))"
|
|
||||||
|
|
||||||
# Pad any trailing digits to effect natural sorting
|
|
||||||
return queryset.extra(
|
|
||||||
select={
|
|
||||||
'name_padded': sql.format(table_name, table_name),
|
|
||||||
}
|
|
||||||
).order_by('name_padded', 'pk')
|
|
||||||
|
|
||||||
|
|
||||||
class InterfaceQuerySet(QuerySet):
|
class InterfaceQuerySet(QuerySet):
|
||||||
|
|
||||||
def connectable(self):
|
def connectable(self):
|
||||||
|
@ -23,7 +23,7 @@ from utilities.utils import serialize_object, to_meters
|
|||||||
from .constants import *
|
from .constants import *
|
||||||
from .exceptions import LoopDetected
|
from .exceptions import LoopDetected
|
||||||
from .fields import ASNField, MACAddressField
|
from .fields import ASNField, MACAddressField
|
||||||
from .managers import DeviceComponentManager, InterfaceManager
|
from .managers import InterfaceManager
|
||||||
|
|
||||||
|
|
||||||
class ComponentTemplateModel(models.Model):
|
class ComponentTemplateModel(models.Model):
|
||||||
@ -982,7 +982,7 @@ class ConsolePortTemplate(ComponentTemplateModel):
|
|||||||
max_length=50
|
max_length=50
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device_type', 'name']
|
ordering = ['device_type', 'name']
|
||||||
@ -1005,7 +1005,7 @@ class ConsoleServerPortTemplate(ComponentTemplateModel):
|
|||||||
max_length=50
|
max_length=50
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device_type', 'name']
|
ordering = ['device_type', 'name']
|
||||||
@ -1040,7 +1040,7 @@ class PowerPortTemplate(ComponentTemplateModel):
|
|||||||
help_text="Allocated current draw (watts)"
|
help_text="Allocated current draw (watts)"
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device_type', 'name']
|
ordering = ['device_type', 'name']
|
||||||
@ -1076,7 +1076,7 @@ class PowerOutletTemplate(ComponentTemplateModel):
|
|||||||
help_text="Phase (for three-phase feeds)"
|
help_text="Phase (for three-phase feeds)"
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device_type', 'name']
|
ordering = ['device_type', 'name']
|
||||||
@ -1166,7 +1166,7 @@ class FrontPortTemplate(ComponentTemplateModel):
|
|||||||
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device_type', 'name']
|
ordering = ['device_type', 'name']
|
||||||
@ -1215,7 +1215,7 @@ class RearPortTemplate(ComponentTemplateModel):
|
|||||||
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device_type', 'name']
|
ordering = ['device_type', 'name']
|
||||||
@ -1238,7 +1238,7 @@ class DeviceBayTemplate(ComponentTemplateModel):
|
|||||||
max_length=50
|
max_length=50
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device_type', 'name']
|
ordering = ['device_type', 'name']
|
||||||
@ -1731,6 +1731,21 @@ class Device(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
|
|||||||
filter |= Q(device__virtual_chassis=self.virtual_chassis, mgmt_only=False)
|
filter |= Q(device__virtual_chassis=self.virtual_chassis, mgmt_only=False)
|
||||||
return Interface.objects.filter(filter)
|
return Interface.objects.filter(filter)
|
||||||
|
|
||||||
|
def get_cables(self, pk_list=False):
|
||||||
|
"""
|
||||||
|
Return a QuerySet or PK list matching all Cables connected to a component of this Device.
|
||||||
|
"""
|
||||||
|
cable_pks = []
|
||||||
|
for component_model in [
|
||||||
|
ConsolePort, ConsoleServerPort, PowerPort, PowerOutlet, Interface, FrontPort, RearPort
|
||||||
|
]:
|
||||||
|
cable_pks += component_model.objects.filter(
|
||||||
|
device=self, cable__isnull=False
|
||||||
|
).values_list('cable', flat=True)
|
||||||
|
if pk_list:
|
||||||
|
return cable_pks
|
||||||
|
return Cable.objects.filter(pk__in=cable_pks)
|
||||||
|
|
||||||
def get_children(self):
|
def get_children(self):
|
||||||
"""
|
"""
|
||||||
Return the set of child Devices installed in DeviceBays within this Device.
|
Return the set of child Devices installed in DeviceBays within this Device.
|
||||||
@ -1769,7 +1784,7 @@ class ConsolePort(CableTermination, ComponentModel):
|
|||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
tags = TaggableManager(through=TaggedItem)
|
tags = TaggableManager(through=TaggedItem)
|
||||||
|
|
||||||
csv_headers = ['device', 'name', 'description']
|
csv_headers = ['device', 'name', 'description']
|
||||||
@ -1813,7 +1828,7 @@ class ConsoleServerPort(CableTermination, ComponentModel):
|
|||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
tags = TaggableManager(through=TaggedItem)
|
tags = TaggableManager(through=TaggedItem)
|
||||||
|
|
||||||
csv_headers = ['device', 'name', 'description']
|
csv_headers = ['device', 'name', 'description']
|
||||||
@ -1882,7 +1897,7 @@ class PowerPort(CableTermination, ComponentModel):
|
|||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
tags = TaggableManager(through=TaggedItem)
|
tags = TaggableManager(through=TaggedItem)
|
||||||
|
|
||||||
csv_headers = ['device', 'name', 'maximum_draw', 'allocated_draw', 'description']
|
csv_headers = ['device', 'name', 'maximum_draw', 'allocated_draw', 'description']
|
||||||
@ -1998,7 +2013,7 @@ class PowerOutlet(CableTermination, ComponentModel):
|
|||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
tags = TaggableManager(through=TaggedItem)
|
tags = TaggableManager(through=TaggedItem)
|
||||||
|
|
||||||
csv_headers = ['device', 'name', 'power_port', 'feed_leg', 'description']
|
csv_headers = ['device', 'name', 'power_port', 'feed_leg', 'description']
|
||||||
@ -2338,7 +2353,7 @@ class FrontPort(CableTermination, ComponentModel):
|
|||||||
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
tags = TaggableManager(through=TaggedItem)
|
tags = TaggableManager(through=TaggedItem)
|
||||||
|
|
||||||
csv_headers = ['device', 'name', 'type', 'rear_port', 'rear_port_position', 'description']
|
csv_headers = ['device', 'name', 'type', 'rear_port', 'rear_port_position', 'description']
|
||||||
@ -2400,7 +2415,7 @@ class RearPort(CableTermination, ComponentModel):
|
|||||||
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
validators=[MinValueValidator(1), MaxValueValidator(64)]
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
tags = TaggableManager(through=TaggedItem)
|
tags = TaggableManager(through=TaggedItem)
|
||||||
|
|
||||||
csv_headers = ['device', 'name', 'type', 'positions', 'description']
|
csv_headers = ['device', 'name', 'type', 'positions', 'description']
|
||||||
@ -2447,7 +2462,7 @@ class DeviceBay(ComponentModel):
|
|||||||
null=True
|
null=True
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DeviceComponentManager()
|
objects = NaturalOrderingManager()
|
||||||
tags = TaggableManager(through=TaggedItem)
|
tags = TaggableManager(through=TaggedItem)
|
||||||
|
|
||||||
csv_headers = ['device', 'name', 'installed_device', 'description']
|
csv_headers = ['device', 'name', 'installed_device', 'description']
|
||||||
|
@ -743,18 +743,18 @@ class InterfaceConnectionTable(BaseTable):
|
|||||||
)
|
)
|
||||||
device_b = tables.LinkColumn(
|
device_b = tables.LinkColumn(
|
||||||
viewname='dcim:device',
|
viewname='dcim:device',
|
||||||
accessor=Accessor('connected_endpoint.device'),
|
accessor=Accessor('_connected_interface.device'),
|
||||||
args=[Accessor('connected_endpoint.device.pk')],
|
args=[Accessor('_connected_interface.device.pk')],
|
||||||
verbose_name='Device B'
|
verbose_name='Device B'
|
||||||
)
|
)
|
||||||
interface_b = tables.LinkColumn(
|
interface_b = tables.LinkColumn(
|
||||||
viewname='dcim:interface',
|
viewname='dcim:interface',
|
||||||
accessor=Accessor('connected_endpoint.name'),
|
accessor=Accessor('_connected_interface'),
|
||||||
args=[Accessor('connected_endpoint.pk')],
|
args=[Accessor('_connected_interface.pk')],
|
||||||
verbose_name='Interface B'
|
verbose_name='Interface B'
|
||||||
)
|
)
|
||||||
description_b = tables.Column(
|
description_b = tables.Column(
|
||||||
accessor=Accessor('connected_endpoint.description'),
|
accessor=Accessor('_connected_interface.description'),
|
||||||
verbose_name='Description'
|
verbose_name='Description'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -148,7 +148,9 @@ class TopologyMapViewSet(ModelViewSet):
|
|||||||
#
|
#
|
||||||
|
|
||||||
class TagViewSet(ModelViewSet):
|
class TagViewSet(ModelViewSet):
|
||||||
queryset = Tag.objects.annotate(tagged_items=Count('extras_taggeditem_items'))
|
queryset = Tag.objects.annotate(
|
||||||
|
tagged_items=Count('taggit_taggeditem_items', distinct=True)
|
||||||
|
)
|
||||||
serializer_class = serializers.TagSerializer
|
serializer_class = serializers.TagSerializer
|
||||||
filterset_class = filters.TagFilter
|
filterset_class = filters.TagFilter
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ from .tables import ConfigContextTable, ObjectChangeTable, TagTable, TaggedItemT
|
|||||||
|
|
||||||
class TagListView(ObjectListView):
|
class TagListView(ObjectListView):
|
||||||
queryset = Tag.objects.annotate(
|
queryset = Tag.objects.annotate(
|
||||||
items=Count('extras_taggeditem_items')
|
items=Count('taggit_taggeditem_items', distinct=True)
|
||||||
).order_by(
|
).order_by(
|
||||||
'name'
|
'name'
|
||||||
)
|
)
|
||||||
|
@ -20,9 +20,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<form method="get">
|
<form method="get">
|
||||||
{% for k, v in request.GET.items %}
|
{% for k, v_list in request.GET.lists %}
|
||||||
{% if k != 'per_page' %}
|
{% if k != 'per_page' %}
|
||||||
<input type="hidden" name="{{ k }}" value="{{ v }}" />
|
{% for v in v_list %}
|
||||||
|
<input type="hidden" name="{{ k }}" value="{{ v }}" />
|
||||||
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<select name="per_page" id="per_page">
|
<select name="per_page" id="per_page">
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-4">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<strong>VLAN</strong>
|
<strong>VLAN</strong>
|
||||||
@ -142,7 +142,7 @@
|
|||||||
{% include 'inc/custom_fields_panel.html' with obj=vlan %}
|
{% include 'inc/custom_fields_panel.html' with obj=vlan %}
|
||||||
{% include 'extras/inc/tags_panel.html' with tags=vlan.tags.all url='ipam:vlan_list' %}
|
{% include 'extras/inc/tags_panel.html' with tags=vlan.tags.all url='ipam:vlan_list' %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-8">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<strong>Prefixes</strong>
|
<strong>Prefixes</strong>
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
|
from django.conf import settings
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.auth import login as auth_login, logout as auth_logout, update_session_auth_hash
|
from django.contrib.auth import login as auth_login, logout as auth_logout, update_session_auth_hash
|
||||||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
||||||
|
from django.contrib.auth.models import update_last_login
|
||||||
|
from django.contrib.auth.signals import user_logged_in
|
||||||
from django.http import HttpResponseForbidden, HttpResponseRedirect
|
from django.http import HttpResponseForbidden, HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
@ -43,6 +46,11 @@ class LoginView(View):
|
|||||||
if not is_safe_url(url=redirect_to, allowed_hosts=request.get_host()):
|
if not is_safe_url(url=redirect_to, allowed_hosts=request.get_host()):
|
||||||
redirect_to = reverse('home')
|
redirect_to = reverse('home')
|
||||||
|
|
||||||
|
# If maintenance mode is enabled, assume the database is read-only, and disable updating the user's
|
||||||
|
# last_login time upon authentication.
|
||||||
|
if settings.MAINTENANCE_MODE:
|
||||||
|
user_logged_in.disconnect(update_last_login, dispatch_uid='update_last_login')
|
||||||
|
|
||||||
# Authenticate user
|
# Authenticate user
|
||||||
auth_login(request, form.get_user())
|
auth_login(request, form.get_user())
|
||||||
messages.info(request, "Logged in as {}.".format(request.user))
|
messages.info(request, "Logged in as {}.".format(request.user))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Django>=2.2,<2.3
|
Django>=2.2,<2.3
|
||||||
django-cacheops==4.1
|
django-cacheops==4.1
|
||||||
django-cors-headers==2.5.2
|
django-cors-headers==2.4.0
|
||||||
django-debug-toolbar==1.11
|
django-debug-toolbar==1.11
|
||||||
django-filter==2.1.0
|
django-filter==2.1.0
|
||||||
django-mptt==0.9.1
|
django-mptt==0.9.1
|
||||||
|
Loading…
Reference in New Issue
Block a user