forked from uncloud/uncloud
amal
b7aa1c6971
- Implement a complete cycle for buying a Matrix Chat Host - Refactor the Payement cycle and stripe related methods
10 lines
No EOL
438 B
Python
10 lines
No EOL
438 B
Python
from matrixhosting.models import VMInstance
|
|
from uncloud_pay.models import Order
|
|
from django.db.models.signals import post_save
|
|
from django.dispatch import receiver
|
|
|
|
@receiver(post_save, sender=Order)
|
|
def create_instance(sender, instance, created, **kwargs):
|
|
machine = VMInstance.objects.filter(order=instance).first()
|
|
if not machine:
|
|
VMInstance.objects.create(owner=instance.owner, order=instance, config=instance.config) |