Merge pull request #157 from BeryJu/dependabot/pip/django-3.1

build(deps): bump django from 3.0.9 to 3.1
This commit is contained in:
Jens L 2020-08-15 21:44:54 +02:00 committed by GitHub
commit 9ebbb51cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 51 additions and 108 deletions

12
Pipfile.lock generated
View File

@ -162,11 +162,11 @@
},
"django": {
"hashes": [
"sha256:96fbe04e8ba0df289171e7f6970e0ff8b472bf4f909ed9e0e5beccbac7e1dbbe",
"sha256:c22b4cd8e388f8219dc121f091e53a8701f9f5bca9aa132b5254263cab516215"
"sha256:1a63f5bb6ff4d7c42f62a519edc2adbb37f9b78068a5a862beff858b68e3dc8b",
"sha256:2d390268a13c655c97e0e2ede9d117007996db692c1bb93eabebd4fb7ea7012b"
],
"index": "pypi",
"version": "==3.0.9"
"version": "==3.1"
},
"django-cors-middleware": {
"hashes": [
@ -1046,11 +1046,11 @@
},
"django": {
"hashes": [
"sha256:96fbe04e8ba0df289171e7f6970e0ff8b472bf4f909ed9e0e5beccbac7e1dbbe",
"sha256:c22b4cd8e388f8219dc121f091e53a8701f9f5bca9aa132b5254263cab516215"
"sha256:1a63f5bb6ff4d7c42f62a519edc2adbb37f9b78068a5a862beff858b68e3dc8b",
"sha256:2d390268a13c655c97e0e2ede9d117007996db692c1bb93eabebd4fb7ea7012b"
],
"index": "pypi",
"version": "==3.0.9"
"version": "==3.1"
},
"django-debug-toolbar": {
"hashes": [

View File

@ -33,7 +33,7 @@ class YAMLString(str):
"""YAML String type"""
class YAMLField(forms.CharField):
class YAMLField(forms.JSONField):
"""Django's JSON Field converted to YAML"""
default_error_messages = {

View File

@ -1,36 +0,0 @@
{% extends "administration/base.html" %}
{% load i18n %}
{% load passbook_utils %}
{% block content %}
<section class="pf-c-page__main-section pf-m-light">
<div class="pf-c-content">
<h1>
<i class="pf-icon pf-icon-applications"></i>
{% trans 'Request' %}
</h1>
</div>
</section>
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-c-card">
<table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
<thead>
<tr role="row">
<th role="columnheader" scope="col" style="min-width: 150px;">{% trans 'Key' %}</th>
<th role="columnheader" scope="col">{% trans 'Value' %}</th>
</tr>
</thead>
<tbody role="rowgroup">
{% for key, value in request_dict.items %}
<tr role="row">
<td role="cell">{{ key }}</td>
<td role="cell">{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
</div>
{% endblock %}

View File

@ -4,7 +4,6 @@ from django.urls import path
from passbook.admin.views import (
applications,
certificate_key_pair,
debug,
flows,
groups,
overview,
@ -235,13 +234,17 @@ urlpatterns = [
name="user-password-reset",
),
# Groups
path("group/", groups.GroupListView.as_view(), name="group"),
path("group/create/", groups.GroupCreateView.as_view(), name="group-create"),
path("groups/", groups.GroupListView.as_view(), name="group"),
path("groups/create/", groups.GroupCreateView.as_view(), name="group-create"),
path(
"group/<uuid:pk>/update/", groups.GroupUpdateView.as_view(), name="group-update"
"groups/<uuid:pk>/update/",
groups.GroupUpdateView.as_view(),
name="group-update",
),
path(
"group/<uuid:pk>/delete/", groups.GroupDeleteView.as_view(), name="group-delete"
"groups/<uuid:pk>/delete/",
groups.GroupDeleteView.as_view(),
name="group-delete",
),
# Certificate-Key Pairs
path(
@ -264,8 +267,4 @@ urlpatterns = [
certificate_key_pair.CertificateKeyPairDeleteView.as_view(),
name="certificatekeypair-delete",
),
# Groups
path("groups/", groups.GroupListView.as_view(), name="groups"),
# Debug
path("debug/request/", debug.DebugRequestView.as_view(), name="debug-request"),
]

View File

@ -1,15 +0,0 @@
"""passbook administration debug views"""
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
class DebugRequestView(LoginRequiredMixin, TemplateView):
"""Show debug info about request"""
template_name = "administration/debug/request.html"
def get_context_data(self, **kwargs):
kwargs["request_dict"] = {}
for key in dir(self.request):
kwargs["request_dict"][key] = getattr(self.request, key)
return super().get_context_data(**kwargs)

View File

@ -2,7 +2,6 @@
import uuid
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
@ -48,12 +47,7 @@ class Migration(migrations.Migration):
),
("date", models.DateTimeField(auto_now_add=True)),
("app", models.TextField()),
(
"context",
django.contrib.postgres.fields.jsonb.JSONField(
blank=True, default=dict
),
),
("context", models.JSONField(blank=True, default=dict),),
("client_ip", models.GenericIPAddressField(null=True)),
("created", models.DateTimeField(auto_now_add=True)),
(

View File

@ -7,12 +7,11 @@ from uuid import UUID, uuid4
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.fields import JSONField
from django.core.exceptions import ValidationError
from django.db import models
from django.http import HttpRequest
from django.utils.translation import gettext as _
from django.views.debug import CLEANSED_SUBSTITUTE, HIDDEN_SETTINGS
from django.views.debug import SafeExceptionReporterFilter
from guardian.shortcuts import get_anonymous_user
from structlog import get_logger
@ -26,8 +25,8 @@ def cleanse_dict(source: Dict[Any, Any]) -> Dict[Any, Any]:
final_dict = {}
for key, value in source.items():
try:
if HIDDEN_SETTINGS.search(key):
final_dict[key] = CLEANSED_SUBSTITUTE
if SafeExceptionReporterFilter.hidden_settings.search(key):
final_dict[key] = SafeExceptionReporterFilter.cleansed_substitute
else:
final_dict[key] = value
except TypeError:
@ -100,7 +99,7 @@ class Event(models.Model):
action = models.TextField(choices=EventAction.as_choices())
date = models.DateTimeField(auto_now_add=True)
app = models.TextField()
context = JSONField(default=dict, blank=True)
context = models.JSONField(default=dict, blank=True)
client_ip = models.GenericIPAddressField(null=True)
created = models.DateTimeField(auto_now_add=True)

View File

@ -4,7 +4,6 @@ import uuid
import django.contrib.auth.models
import django.contrib.auth.validators
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
import django.utils.timezone
import guardian.mixins
@ -109,12 +108,7 @@ class Migration(migrations.Migration):
("uuid", models.UUIDField(default=uuid.uuid4, editable=False)),
("name", models.TextField(help_text="User's display name.")),
("password_change_date", models.DateTimeField(auto_now_add=True)),
(
"attributes",
django.contrib.postgres.fields.jsonb.JSONField(
blank=True, default=dict
),
),
("attributes", models.JSONField(blank=True, default=dict),),
],
options={"permissions": (("reset_user_password", "Reset Password"),),},
bases=(guardian.mixins.GuardianUserMixin, models.Model),
@ -264,12 +258,7 @@ class Migration(migrations.Migration):
),
),
("name", models.CharField(max_length=80, verbose_name="name")),
(
"attributes",
django.contrib.postgres.fields.jsonb.JSONField(
blank=True, default=dict
),
),
("attributes", models.JSONField(blank=True, default=dict),),
(
"parent",
models.ForeignKey(

View File

@ -0,0 +1,20 @@
# Generated by Django 3.1 on 2020-08-15 18:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("passbook_core", "0006_auto_20200709_1608"),
]
operations = [
migrations.AlterField(
model_name="user",
name="first_name",
field=models.CharField(
blank=True, max_length=150, verbose_name="first name"
),
),
]

View File

@ -4,7 +4,6 @@ from typing import Any, Optional, Type
from uuid import uuid4
from django.contrib.auth.models import AbstractUser
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.db.models import Q, QuerySet
from django.forms import ModelForm
@ -42,7 +41,7 @@ class Group(models.Model):
on_delete=models.SET_NULL,
related_name="children",
)
attributes = JSONField(default=dict, blank=True)
attributes = models.JSONField(default=dict, blank=True)
def __str__(self):
return f"Group {self.name}"
@ -62,7 +61,7 @@ class User(GuardianUserMixin, AbstractUser):
groups = models.ManyToManyField("Group")
password_change_date = models.DateTimeField(auto_now_add=True)
attributes = JSONField(default=dict, blank=True)
attributes = models.JSONField(default=dict, blank=True)
def set_password(self, password):
if self.pk:

View File

@ -136,7 +136,7 @@ class ConfigLoader:
root = root.get(sub, None)
# Walk each component of the path
for comp in path.split(sep):
if comp in root:
if root and comp in root:
root = root.get(comp)
else:
return default

View File

@ -67,7 +67,6 @@ INSTALLED_APPS = [
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.postgres",
"django.contrib.humanize",
"rest_framework",
"django_filters",

View File

@ -28,5 +28,5 @@ class InvitationForm(forms.ModelForm):
labels = {
"fixed_data": _("Optional fixed data to enforce on user enrollment."),
}
widgets = {"fixed_data": CodeMirrorWidget}
widgets = {"fixed_data": CodeMirrorWidget()}
field_classes = {"fixed_data": YAMLField}

View File

@ -2,7 +2,6 @@
import uuid
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
@ -59,10 +58,7 @@ class Migration(migrations.Migration):
),
),
("expires", models.DateTimeField(blank=True, default=None, null=True)),
(
"fixed_data",
django.contrib.postgres.fields.jsonb.JSONField(default=dict),
),
("fixed_data", models.JSONField(default=dict),),
(
"created_by",
models.ForeignKey(

View File

@ -2,7 +2,6 @@
from typing import Type
from uuid import uuid4
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.forms import ModelForm
from django.utils.translation import gettext_lazy as _
@ -53,7 +52,7 @@ class Invitation(models.Model):
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
expires = models.DateTimeField(default=None, blank=True, null=True)
fixed_data = JSONField(default=dict)
fixed_data = models.JSONField(default=dict)
def __str__(self):
return f"Invitation {self.invite_uuid.hex} created by {self.created_by}"

View File

@ -5477,7 +5477,7 @@ definitions:
minLength: 1
context:
title: Context
type: object
type: string
client_ip:
title: Client ip
type: string
@ -5565,7 +5565,7 @@ definitions:
uniqueItems: true
attributes:
title: Attributes
type: object
type: string
Message:
type: object
properties:
@ -6777,7 +6777,7 @@ definitions:
x-nullable: true
fixed_data:
title: Fixed data
type: object
type: string
OTPStaticStage:
required:
- name