Skip to content

Commit

Permalink
Remove SENTRY_URL_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Gaeta committed May 6, 2022
1 parent 96925a7 commit 53c8021
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 171 deletions.
5 changes: 0 additions & 5 deletions src/sentry/options/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,6 @@ def get(self, key, silent=False):
if not (opt.flags & FLAG_NOSTORE):
result = self.store.get(opt, silent=silent)
if result is not None:
# HACK(mattrobenolt): SENTRY_URL_PREFIX must be kept in sync
# when reading values from the database. This should
# be replaced by a signal.
if key == "system.url-prefix":
settings.SENTRY_URL_PREFIX = result
return result

# Some values we don't want to allow them to be configured through
Expand Down
8 changes: 0 additions & 8 deletions src/sentry/runner/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ def apply_legacy_settings(settings):

for old, new in (
("SENTRY_ADMIN_EMAIL", "system.admin-email"),
("SENTRY_URL_PREFIX", "system.url-prefix"),
("SENTRY_SYSTEM_MAX_EVENTS_PER_MINUTE", "system.rate-limit"),
("SENTRY_ENABLE_EMAIL_REPLIES", "mail.enable-replies"),
("SENTRY_SMTP_HOSTNAME", "mail.reply-hostname"),
Expand Down Expand Up @@ -573,13 +572,6 @@ def apply_legacy_settings(settings):
# option.)
settings.SENTRY_REDIS_OPTIONS = options.get("redis.clusters")["default"]

if not hasattr(settings, "SENTRY_URL_PREFIX"):
url_prefix = options.get("system.url-prefix", silent=True)
if not url_prefix:
# HACK: We need to have some value here for backwards compatibility
url_prefix = "http://sentry.example.com"
settings.SENTRY_URL_PREFIX = url_prefix

if settings.TIME_ZONE != "UTC":
# non-UTC timezones are not supported
show_big_error("TIME_ZONE should be set to UTC")
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/templatetags/sentry_avatars.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from urllib.parse import urlencode

from django import template
from django.conf import settings
from django.urls import reverse
from django.utils.safestring import mark_safe

from sentry import options
from sentry.models import User, UserAvatar
from sentry.utils.avatar import get_email_avatar, get_gravatar_url, get_letter_avatar

Expand Down Expand Up @@ -33,7 +33,7 @@ def profile_photo_url(context, user_id, size=None):
url = reverse("sentry-user-avatar-url", args=[avatar.ident])
if size:
url += "?" + urlencode({"s": size})
return settings.SENTRY_URL_PREFIX + url
return options.get("system.url-prefix") + url


# Don't use this in any situations where you're rendering more
Expand Down
155 changes: 0 additions & 155 deletions static/app/constants/ios-device-list.tsx

This file was deleted.

1 change: 0 additions & 1 deletion tests/sentry/runner/test_initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def test_apply_legacy_settings(settings):
settings.SENTRY_USE_QUEUE = True
settings.SENTRY_ALLOW_REGISTRATION = True
settings.SENTRY_ADMIN_EMAIL = "admin-email"
settings.SENTRY_URL_PREFIX = "http://url-prefix"
settings.SENTRY_SYSTEM_MAX_EVENTS_PER_MINUTE = 10
settings.SENTRY_REDIS_OPTIONS = {"foo": "bar"}
settings.SENTRY_ENABLE_EMAIL_REPLIES = True
Expand Down

0 comments on commit 53c8021

Please sign in to comment.