mirror of
https://github.com/retspen/webvirtcloud
synced 2026-07-13 23:15:41 +00:00
Compare commits
No commits in common. "43fc41949046c5fc5c718b06c3bca9b515300b15" and "ca54ae0c653f5872989b7c40dc43bad39e77cf26" have entirely different histories.
43fc419490
...
ca54ae0c65
2 changed files with 3 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ def user_create(request):
|
||||||
@superuser_only
|
@superuser_only
|
||||||
def user_update(request, pk):
|
def user_update(request, pk):
|
||||||
user = get_object_or_404(User, pk=pk)
|
user = get_object_or_404(User, pk=pk)
|
||||||
attributes, attributes_created = UserAttributes.objects.get_or_create(user=user)
|
attributes = UserAttributes.objects.get(user=user)
|
||||||
user_form = forms.UserForm(request.POST or None, instance=user)
|
user_form = forms.UserForm(request.POST or None, instance=user)
|
||||||
attributes_form = forms.UserAttributesForm(
|
attributes_form = forms.UserAttributesForm(
|
||||||
request.POST or None, instance=attributes
|
request.POST or None, instance=attributes
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import os
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from accounts.models import UserInstance, UserAttributes
|
from accounts.models import UserInstance
|
||||||
from appsettings.settings import app_settings
|
from appsettings.settings import app_settings
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
@ -26,7 +26,7 @@ def get_clone_free_names(size=10):
|
||||||
|
|
||||||
|
|
||||||
def check_user_quota(user, instance, cpu, memory, disk_size):
|
def check_user_quota(user, instance, cpu, memory, disk_size):
|
||||||
ua, attributes_created = UserAttributes.objects.get_or_create(user=user)
|
ua = user.userattributes
|
||||||
msg = ""
|
msg = ""
|
||||||
|
|
||||||
if user.is_superuser:
|
if user.is_superuser:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue