Merge pull request #3007 from hughrun/signed-get

create instance user on instance creation
This commit is contained in:
Mouse Reeve 2023-10-02 09:52:59 -07:00 committed by GitHub
commit 458b258ad5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -4,7 +4,11 @@ import sys
from .base_activity import ActivityEncoder, Signature, naive_parse from .base_activity import ActivityEncoder, Signature, naive_parse
from .base_activity import Link, Mention, Hashtag from .base_activity import Link, Mention, Hashtag
from .base_activity import ActivitySerializerError, resolve_remote_id from .base_activity import (
ActivitySerializerError,
resolve_remote_id,
get_representative,
)
from .image import Document, Image from .image import Document, Image
from .note import Note, GeneratedNote, Article, Comment, Quotation from .note import Note, GeneratedNote, Article, Comment, Quotation
from .note import Review, Rating from .note import Review, Rating

View file

@ -72,7 +72,7 @@ class SetupViews(TestCase):
self.site.refresh_from_db() self.site.refresh_from_db()
self.assertFalse(self.site.install_mode) self.assertFalse(self.site.install_mode)
user = models.User.objects.get() user = models.User.objects.first()
self.assertTrue(user.is_active) self.assertTrue(user.is_active)
self.assertTrue(user.is_superuser) self.assertTrue(user.is_superuser)
self.assertTrue(user.is_staff) self.assertTrue(user.is_staff)

View file

@ -9,6 +9,7 @@ from django.shortcuts import redirect
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.views import View from django.views import View
from bookwyrm.activitypub import get_representative
from bookwyrm import forms, models from bookwyrm import forms, models
from bookwyrm import settings from bookwyrm import settings
from bookwyrm.utils import regex from bookwyrm.utils import regex
@ -96,4 +97,5 @@ class CreateAdmin(View):
login(request, user) login(request, user)
site.install_mode = False site.install_mode = False
site.save() site.save()
get_representative() # create the instance user
return redirect("settings-site") return redirect("settings-site")