~netlandish/django-wiki

cf336699e491089cda8d436a0043765064fbc520 — Oscar Cortez 4 years ago 472fa9d
Add support for user organization manager
1 files changed, 6 insertions(+), 2 deletions(-)

M src/wiki/views/article.py
M src/wiki/views/article.py => src/wiki/views/article.py +6 -2
@@ 967,10 967,14 @@ class CreateRootView(FormView):
    template_name = 'wiki/create_root.html'

    def dispatch(self, request, *args, **kwargs):
        if not request.user.is_superuser:
        org = request.organization
        if (
            not request.user.is_org_manager
            or not org.wiki_admins.filter(id=request.user.id).exists()
            or not request.user.is_superuser
        ):
            return redirect("wiki:root_missing")

        org = request.organization
        try:
            root = models.URLPath.root(org)
            if request.method == "GET" and root.article.organization != org: