This commit is contained in:
Eugene Pankov
2021-07-28 22:14:34 +02:00
parent b3bb9fdd40
commit 0484b4c8d7
13 changed files with 146 additions and 15 deletions

View File

@@ -131,7 +131,7 @@ class UserSerializer(ModelSerializer):
read_only_fields = ('id', 'username')
def get_is_pro(self, obj):
return check_is_sponsor_cached(obj) or obj.force_pro
return obj.force_pro or not settings.GITHUB_ELIGIBLE_SPONSORSHIPS or check_is_sponsor_cached(obj)
def get_is_sponsor(self, obj):
return check_is_sponsor_cached(obj)

View File

@@ -8,6 +8,8 @@ from urllib.parse import urlparse
class IndexView(APIView):
def get(self, request, format=None):
if settings.FRONTEND_URL:
return HttpResponseRedirect(settings.FRONTEND_URL)
return static.serve(request, 'index.html', document_root=str(settings.FRONTEND_BUILD_DIR))