Browse Source

perf: 修复基本设置中的 base_site 可能带 / 的问题

pull/7404/head
ibuler 3 years ago committed by Jiangjie.Bai
parent
commit
b113eeb1d6
  1. 7
      apps/settings/serializers/basic.py

7
apps/settings/serializers/basic.py

@ -44,3 +44,10 @@ class BasicSettingSerializer(serializers.Serializer):
TICKETS_ENABLED = serializers.BooleanField(required=False, default=True, label=_("Enable tickets")) TICKETS_ENABLED = serializers.BooleanField(required=False, default=True, label=_("Enable tickets"))
ANNOUNCEMENT_ENABLED = serializers.BooleanField(label=_('Enable announcement'), default=True) ANNOUNCEMENT_ENABLED = serializers.BooleanField(label=_('Enable announcement'), default=True)
ANNOUNCEMENT = AnnouncementSerializer(label=_("Announcement")) ANNOUNCEMENT = AnnouncementSerializer(label=_("Announcement"))
@staticmethod
def validate_SITE_URL(s):
if not s:
return 'http://127.0.0.1'
return s.strip('/')

Loading…
Cancel
Save