Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions tcms_github_marketplace/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,10 @@ class CreateTenant(NewTenantView):

def dispatch(self, request, *args, **kwargs):
"""
Jump over NewTenantView class b/c it requires the tcms_tenants.add_tenant
NewTenantView class requires the ``tcms_tenants.add_tenant``
permission while on Marketplace we allow everyone who had paid their subscription
to create tenants!
to create tenants! Because of this simulate that they have permission to
create a tenant!
"""
# we take the most recent purchase event for this user
# where they purchase a paid plan
Expand All @@ -364,9 +365,7 @@ def dispatch(self, request, *args, **kwargs):
if not self.organization:
self.organization = utils.organization_from_purchase(self.purchase)

return super(NewTenantView, self).dispatch( # pylint: disable=bad-super-call
request, *args, **kwargs
)
return super().dispatch(request, *args, **kwargs)

def check(self, request):
"""
Expand Down