Split SubscriptionForm into SubscriptionNewUserForm and SubscriptionExistingUserForm

This commit is contained in:
imperosol
2024-11-19 00:41:49 +01:00
parent 75406f7b58
commit d2d639e5f6
14 changed files with 280 additions and 187 deletions

View File

@ -529,13 +529,15 @@ class User(AbstractBaseUser):
return False
@cached_property
def can_create_subscription(self):
from club.models import Club
def can_create_subscription(self) -> bool:
from club.models import Membership
for club in Club.objects.filter(id__in=settings.SITH_CAN_CREATE_SUBSCRIPTIONS):
if club in self.clubs_with_rights:
return True
return False
return (
Membership.objects.board()
.ongoing()
.filter(club_id__in=settings.SITH_CAN_CREATE_SUBSCRIPTIONS)
.exists()
)
@cached_property
def is_launderette_manager(self):

View File

@ -1,3 +1,5 @@
import htmx from "htmx.org";
import "htmx-ext-response-targets/response-targets";
Object.assign(window, { htmx });

View File

@ -262,8 +262,10 @@ a:not(.button) {
font-weight: normal;
color: white;
padding: 9px 13px;
margin: 3px;
border: none;
text-decoration: none;
text-align: center;
border-radius: 5px;
&.btn-blue {
@ -367,6 +369,7 @@ a:not(.button) {
.alert-aside {
display: flex;
flex-direction: column;
gap: 5px;
}
}