mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Split SubscriptionForm
into SubscriptionNewUserForm
and SubscriptionExistingUserForm
This commit is contained in:
@ -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):
|
||||
|
@ -1,3 +1,5 @@
|
||||
import htmx from "htmx.org";
|
||||
|
||||
import "htmx-ext-response-targets/response-targets";
|
||||
|
||||
Object.assign(window, { htmx });
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user