Remove reduntant AccessLog.trusted flag

All attempts that are logged are marked as trusted
and no other attempts are created in the code,
so having a flag that also uses a database index
is redundant and unnecessary.

Signed-off-by: Aleksi Häkli <aleksi.hakli@iki.fi>
This commit is contained in:
Aleksi Häkli 2019-03-13 15:49:51 +02:00
parent 7d84491f1b
commit e24f0453bb
No known key found for this signature in database
GPG key ID: 3E7146964D726BBE
4 changed files with 17 additions and 9 deletions

View file

@ -96,7 +96,6 @@ class AccessLogAdmin(admin.ModelAdmin):
'user_agent',
'ip_address',
'username',
'trusted',
'http_accept',
'path_info',
'attempt_time',

View file

@ -155,7 +155,6 @@ class AxesDatabaseHandler(AxesBaseHandler): # pylint: disable=too-many-locals
http_accept=request.axes_http_accept,
path_info=request.axes_path_info,
attempt_time=request.axes_attempt_time,
trusted=True,
)
if settings.AXES_RESET_ON_SUCCESS:

View file

@ -0,0 +1,17 @@
# Generated by Django 2.0.4 on 2019-03-13 08:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('axes', '0005_remove_accessattempt_trusted'),
]
operations = [
migrations.RemoveField(
model_name='accesslog',
name='trusted',
),
]

View file

@ -65,13 +65,6 @@ class AccessAttempt(AccessBase):
class AccessLog(AccessBase):
# Once a user logs in from an ip, that combination is trusted and not
# locked out in case of a distributed attack
trusted = models.BooleanField(
default=False,
db_index=True,
)
logout_time = models.DateTimeField(
_('Logout Time'),
null=True,