mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-09 00:35:51 +00:00
Set default auth user group to editor on initdb
This commit is contained in:
parent
7ae983acdf
commit
c991733c8d
2 changed files with 12 additions and 0 deletions
|
@ -117,10 +117,12 @@ def init_connectors():
|
|||
|
||||
def init_settings():
|
||||
"""info about the instance"""
|
||||
group_editor = Group.objects.filter(name="editor").first()
|
||||
models.SiteSettings.objects.create(
|
||||
support_link="https://www.patreon.com/bookwyrm",
|
||||
support_title="Patreon",
|
||||
install_mode=True,
|
||||
default_user_auth_group=group_editor,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -63,9 +63,19 @@ class InitDB(TestCase):
|
|||
|
||||
def test_init_settings(self):
|
||||
"""Create the settings file"""
|
||||
initdb.init_groups()
|
||||
group_editor = Group.objects.get(name="editor")
|
||||
|
||||
initdb.init_settings()
|
||||
settings = models.SiteSettings.objects.get()
|
||||
self.assertEqual(settings.name, "BookWyrm")
|
||||
self.assertEqual(settings.default_user_auth_group, group_editor)
|
||||
|
||||
def test_init_settings_without_groups(self):
|
||||
"""Create the settings, but without groups existing already"""
|
||||
initdb.init_settings()
|
||||
settings = models.SiteSettings.objects.get()
|
||||
self.assertIsNone(settings.default_user_auth_group)
|
||||
|
||||
def test_init_link_domains(self):
|
||||
"""Common trusted domains for links"""
|
||||
|
|
Loading…
Reference in a new issue