Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.web
Commits
3e82ddb5
Commit
3e82ddb5
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[settings] Suppress django 1.10 deprecation warning caused by django jsonfield provisionally
parent
3288fa33
No related branches found
No related tags found
1 merge request
!194
Scheduler
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/settings/settings.py
+21
-0
21 additions, 0 deletions
beat/web/settings/settings.py
with
21 additions
and
0 deletions
beat/web/settings/settings.py
+
21
−
0
View file @
3e82ddb5
...
...
@@ -126,6 +126,27 @@ LOGGING = {
}
}
##############################################################################
#
# Special code to remove Django 1.10 deprecation warnings caused by
# Django-JSONField while that is not resolved:
# https://bitbucket.org/schinckel/django-jsonfield/issues/46/django-190-complains-about-subfieldbase
# Current django-jsonfield available: 0.9.19 (28.04.2016)
#
##############################################################################
import
logging
class
SuppressDeprecated
(
logging
.
Filter
):
def
filter
(
self
,
record
):
WARNINGS_TO_SUPPRESS
=
[
'
RemovedInDjango110Warning
'
,
]
# Return false to suppress message.
return
not
any
([
warn
in
record
.
getMessage
()
for
warn
in
WARNINGS_TO_SUPPRESS
])
warn_logger
=
logging
.
getLogger
(
'
py.warnings
'
)
warn_logger
.
addFilter
(
SuppressDeprecated
())
##############################################################################
#
# DATABASE
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment