Merge pull request 'Bugfixes: Redirect URI protocol, org create' (#25) from bugfixes into main
Reviewed-on: https://servala-2nkgm.app.codey.ch/servala/servala-portal/pulls/25
This commit is contained in:
commit
4cd5653b99
3 changed files with 10 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -167,3 +167,5 @@ deployment/secrets/*
|
||||||
|
|
||||||
# Various local folders
|
# Various local folders
|
||||||
tmp/
|
tmp/
|
||||||
|
static.dist/
|
||||||
|
media/
|
||||||
|
|
|
@ -5,7 +5,7 @@ from django.db import models
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django_scopes import ScopedManager
|
from django_scopes import ScopedManager, scopes_disabled
|
||||||
|
|
||||||
from servala.core import rules as perms
|
from servala.core import rules as perms
|
||||||
from servala.core.models.mixins import ServalaModelMixin
|
from servala.core.models.mixins import ServalaModelMixin
|
||||||
|
@ -47,6 +47,7 @@ class Organization(ServalaModelMixin, models.Model):
|
||||||
return self.urls.base
|
return self.urls.base
|
||||||
|
|
||||||
def set_owner(self, user):
|
def set_owner(self, user):
|
||||||
|
with scopes_disabled():
|
||||||
OrganizationMembership.objects.filter(user=user, organization=self).delete()
|
OrganizationMembership.objects.filter(user=user, organization=self).delete()
|
||||||
OrganizationMembership.objects.create(
|
OrganizationMembership.objects.create(
|
||||||
user=user, organization=self, role=OrganizationRole.OWNER
|
user=user, organization=self, role=OrganizationRole.OWNER
|
||||||
|
|
|
@ -174,6 +174,8 @@ ACCOUNT_UNIQUE_EMAIL = True
|
||||||
ACCOUNT_LOGIN_METHODS = {"email"}
|
ACCOUNT_LOGIN_METHODS = {"email"}
|
||||||
ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"]
|
ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"]
|
||||||
ACCOUNT_SIGNUP_FORM_CLASS = "servala.frontend.forms.auth.ServalaSignupForm"
|
ACCOUNT_SIGNUP_FORM_CLASS = "servala.frontend.forms.auth.ServalaSignupForm"
|
||||||
|
if ALLOWED_HOSTS or not DEBUG:
|
||||||
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = [
|
AUTHENTICATION_BACKENDS = [
|
||||||
"rules.permissions.ObjectPermissionBackend",
|
"rules.permissions.ObjectPermissionBackend",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue