implement credit card listing
This commit is contained in:
parent
e2c4a19049
commit
e225bf1cc0
12 changed files with 183 additions and 63 deletions
|
|
@ -4,9 +4,24 @@ from .models import *
|
|||
from .selectors import *
|
||||
from .tasks import *
|
||||
|
||||
|
||||
@transaction.atomic
|
||||
def create_wireguard_vpn(owner, public_key, network_mask):
|
||||
# Check if the user has a membership.
|
||||
#------------------------------------
|
||||
# If yes, user is eligible for API access and 2 VPNs
|
||||
# If user already has 2 VPNs, we deduct from the credit
|
||||
# If deduction is higher than the allowed credit, we fail
|
||||
|
||||
|
||||
#
|
||||
# Check if the user has suitable balance
|
||||
# Create order
|
||||
#
|
||||
return create_wireguard_vpn_tech(owner, public_key, network_mask)
|
||||
|
||||
@transaction.atomic
|
||||
def create_wireguard_vpn_tech(owner, public_key, network_mask):
|
||||
pool = get_suitable_pools(network_mask)[0]
|
||||
count = pool.wireguardvpn_set.count()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue