from __future__ import absolute_import, print_function

from sentry.http import get_server_hostname


class AllowedHosts(object):
    # HACK: This is a fake stub for settings.ALLOWED_HOSTS
    # This is needing since ALLOWED_HOSTS is engrained
    # in Django internals, so we want this "tuple" to respond
    # to runtime changes based on our system.url-prefix Option
    def __iter__(self):
        yield get_server_hostname() or '*'

from __future__ import absolute_import, print_function

from sentry.http import get_server_hostname


class AllowedHosts(object):
    # HACK: This is a fake stub for settings.ALLOWED_HOSTS
    # This is needing since ALLOWED_HOSTS is engrained
    # in Django internals, so we want this "tuple" to respond
    # to runtime changes based on our system.url-prefix Option
    def __iter__(self):
        yield get_server_hostname() or '*'

    def __repr__(self):
        return repr(tuple(self))

Add a nice repr for AllowedHosts object so the admin makes sense
Add a nice repr for AllowedHosts object so the admin makes sense

  from __future__ import absolute_import, print_function
  
  from sentry.http import get_server_hostname
  
  
  class AllowedHosts(object):
      # HACK: This is a fake stub for settings.ALLOWED_HOSTS
      # This is needing since ALLOWED_HOSTS is engrained
      # in Django internals, so we want this "tuple" to respond
      # to runtime changes based on our system.url-prefix Option
      def __iter__(self):
          yield get_server_hostname() or '*'
  
+     def __repr__(self):
+         return repr(tuple(self))
+ 
Add a nice repr for AllowedHosts object so the admin makes sense
## Code Before:
from __future__ import absolute_import, print_function

from sentry.http import get_server_hostname


class AllowedHosts(object):
    # HACK: This is a fake stub for settings.ALLOWED_HOSTS
    # This is needing since ALLOWED_HOSTS is engrained
    # in Django internals, so we want this "tuple" to respond
    # to runtime changes based on our system.url-prefix Option
    def __iter__(self):
        yield get_server_hostname() or '*'

## Instruction:
Add a nice repr for AllowedHosts object so the admin makes sense
## Code After:
from __future__ import absolute_import, print_function

from sentry.http import get_server_hostname


class AllowedHosts(object):
    # HACK: This is a fake stub for settings.ALLOWED_HOSTS
    # This is needing since ALLOWED_HOSTS is engrained
    # in Django internals, so we want this "tuple" to respond
    # to runtime changes based on our system.url-prefix Option
    def __iter__(self):
        yield get_server_hostname() or '*'

    def __repr__(self):
        return repr(tuple(self))
