mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 11:01:12 +00:00
Merge pull request #3007 from hughrun/signed-get
create instance user on instance creation
This commit is contained in:
commit
458b258ad5
3 changed files with 8 additions and 2 deletions
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue