-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix admin pages when group has no organization
Fix a crash on the admin page for editing an open or restricted group when the group has no organization. Fixes: #9009 Problem ------- Open and restricted groups have admin pages that let Hypothesis admins edit the group (type, name, organization, creator, description, scopes, members). You go to https://hypothes.is/admin/groups, search for the open or restricted group that you want, and click on that group's name to go to the `https://hypothes.is/admin/groups/<PUBID>` admin page for editing that group. Private groups do not have admin pages, that's why many of the group names on the the https://hypothes.is/admin/groups admin page aren't linked: those are private groups. Originally the only way to create an open or restricted group was via the https://hypothes.is/admin/groups/new admin page, and that page forces you to choose an organization for the open or restricted group to belong to. The `https://hypothes.is/admin/groups/<PUBID>` page could therefore assume that all open or restricted groups belong to an organization. Recently we've enabled users to create their own open or restricted groups via the https://hypothes.is/groups/new page and groups created by this page do not have organizations. Private groups created by this page have never belonged to organizations. The open and restricted groups that can now also be created don't have organizations either. A user could also create a private group with no organization and then turn it into an open or restricted group. So for the first time it's now possible to have open and restricted groups with no organizations. But the `https://hypothes.is/admin/groups/<PUBID>` admin page for editing open or restricted groups has two problems with this: 1. Loading the page crashes when the group has no organization 2. The form forces groups to belong to an organization, there's no option for a group to not have an organization Solution -------- This commit fixes the page to not crash when a group has no organization and also adds a "-- None --" option to the form's organization dropdown so that it no longer forces you to select an organization when creating or editing a group. As a side effect of these changes admins can now also use the https://hypothes.is/admin/groups/new admin page to create open and restricted groups with no organization, and some further fixes were needed to prevent this from crashing.
- Loading branch information
Showing
6 changed files
with
140 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters