mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
* fixes #965: intermittent bug during consolidation of notifications * fixes #863: better visibility for input validation errors * fixes #375: re-evaluate affiliation requests on email change * fixes #741: remove data quality validation for superusers * fixes #587: customizable pagination in django admin * fixes #923: Prevent deletion of a last technical contact if there is an existing netixlan object * better search #23 (first pass) * black format * haystack test config to run_tests.py remove old django_init.py test settings * black format * haystack test config fixes * #23 better search (pt.2) * rate limit distance queries (#23) rate limiting based on query filters * settings controlled blocking of distance filter for unauthenticated / unverified users (#23) * fix distance filter throttling with api key auth (#23) * fix anon user access check on distance queries * search index and performance tweaks * fix org_id not set in search results * org id to int Co-authored-by: Stefan Pratter <stefan@20c.com>
25 lines
594 B
Python
25 lines
594 B
Python
from peeringdb_server.context import current_request
|
|
|
|
|
|
def bypass_validation(request=None):
|
|
|
|
"""
|
|
Returns whether the specified request is to bypass
|
|
certain data quality validations (#741)
|
|
|
|
If not rquest is passed we will attempt to get
|
|
the current request from the current request
|
|
context.
|
|
|
|
If no request can be obtained this will return False
|
|
"""
|
|
|
|
if not request:
|
|
with current_request() as _request:
|
|
request = _request
|
|
|
|
if not request or not getattr(request, "user", None):
|
|
return False
|
|
|
|
return request.user.is_superuser
|