uncloud-mravi/uncloud_auth/models.py
Nico Schottelius 0fd5ac18cd do not import pay->auth
Try to keep common things in the "uncloud" module
2020-12-06 11:53:37 +01:00

17 lines
583 B
Python

from django.contrib.auth.models import AbstractUser
from django.db import models
from django.core.validators import MinValueValidator
from uncloud import AMOUNT_DECIMALS, AMOUNT_MAX_DIGITS
class User(AbstractUser):
"""
We use the standard user and add a maximum credit that is allowed
to be accumulated. After that we need to have warnings, cancellation, etc.
"""
maximum_credit = models.DecimalField(
default=0.0,
max_digits=AMOUNT_MAX_DIGITS,
decimal_places=AMOUNT_DECIMALS,
validators=[MinValueValidator(0)])