commit 2.1

This commit is contained in:
Krzysztof Bonecki 2020-12-07 21:45:56 +01:00
parent 21be6f6d0e
commit e368ca65be
2 changed files with 3 additions and 5 deletions

View File

@ -10,8 +10,7 @@ def check_user_is_auth(request):
def check_user_is_owner(request):
if check_user_is_auth == True:
if request.users.Base_user.status =="Company_Account": #sprawdza czy uzytkownik ma status konta firmowego
return True
if request.users.Base_user.status =="Company_Account": # check if user has status 'owner'
else:
render (request,'upgrade-to-onwer.html')

View File

@ -45,7 +45,7 @@ class Base_User(AbstractBaseUser,PermissionsMixin):
is_active = models.BooleanField(default=True)
date_joined = models.DateTimeField(_('Date joined'),auto_now_add=True)
#last_login = models.DateTimeField(_("Last Login"),auto_now_add= Tr ) #dodać funkcję w view która podczas kazdego logowania będzie zmieniala wartosc tego pola
#last_login = models.DateTimeField(_("Last Login"),auto_now_add= Tr )
status = models.CharField(max_length=32, choices=STATUS, default='BaseAcc')
USERNAME_FIELD = 'email'
@ -67,7 +67,7 @@ class NormalUser(models.Model):
first_name = models.CharField(_('First Name'), max_length=30, blank = False)
last_name = models.CharField(_('Last name'), max_length=30, blank = False)
birth_date = models.DateField(_('Birth date'),null=True, blank=True)
#dodac pola Country, state, postal code, city, address1, address2
#add fields Country, state, postal code, city, address1, address2
@ -82,5 +82,4 @@ class OwnerUser(models.Model):
#dodac dane typu NIP/PESEL, adres, plik weryfikujący firmę / PESEL