fix(api): allow generating schema without db connection

This commit is contained in:
jo 2023-02-04 21:53:06 +01:00 committed by Georg Krause
parent 6e17a8e7b1
commit 9bfc83f0e4
2 changed files with 5 additions and 1 deletions

View File

@ -57,8 +57,11 @@ class RegisterSerializer(BaseRegisterSerializer):
)
def __init__(self, *args, **kwargs):
self.approval_enabled = preferences.get("moderation__signup_approval_enabled")
super().__init__(*args, **kwargs)
if getattr(self.context["view"], "swagger_fake_view", False):
return
self.approval_enabled = preferences.get("moderation__signup_approval_enabled")
if self.approval_enabled:
customization = preferences.get("moderation__signup_form_customization")
self.fields[

View File

@ -0,0 +1 @@
Allow generating api schema without db connection