mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
set anonymous user context for whois output
This commit is contained in:
@@ -4,6 +4,8 @@ import logging
|
||||
|
||||
from ._db_command import CommandError, DBCommand
|
||||
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
|
||||
from peeringdb.whois import WhoisFormat
|
||||
from peeringdb_server import models
|
||||
from peeringdb_server import serializers
|
||||
@@ -58,6 +60,6 @@ class Command(DBCommand):
|
||||
log.error("Unknown ref tag: %s" % ref_tag)
|
||||
raise ValueError(msg)
|
||||
|
||||
data = Serializer(obj).data
|
||||
data = Serializer(obj, context={"user":AnonymousUser()}).data
|
||||
fmt = WhoisFormat()
|
||||
fmt. print(obj._handleref.tag, data)
|
||||
|
Reference in New Issue
Block a user