From 54687b7b358bdbd957feda7bb01c96e8bd4f2db4 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 28 Feb 2021 13:45:49 -0800 Subject: [PATCH] Make users editors by default --- bookwyrm/models/user.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index f137236c..21ef8dd2 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -3,7 +3,7 @@ import re from urllib.parse import urlparse from django.apps import apps -from django.contrib.auth.models import AbstractUser +from django.contrib.auth.models import AbstractUser, Group from django.core.validators import MinValueValidator from django.db import models from django.utils import timezone @@ -208,6 +208,9 @@ class User(OrderedCollectionPageMixin, AbstractUser): # an id needs to be set before we can proceed with related models super().save(*args, **kwargs) + # make users editors by default + self.groups.add(Group.objects.get(name='editor')) + # create keys and shelves for new local users self.key_pair = KeyPair.objects.create( remote_id='%s/#main-key' % self.remote_id)