commit 2.1
This commit is contained in:
parent
21be6f6d0e
commit
e368ca65be
@ -10,8 +10,7 @@ def check_user_is_auth(request):
|
|||||||
|
|
||||||
def check_user_is_owner(request):
|
def check_user_is_owner(request):
|
||||||
if check_user_is_auth == True:
|
if check_user_is_auth == True:
|
||||||
if request.users.Base_user.status =="Company_Account": #sprawdza czy uzytkownik ma status konta firmowego
|
if request.users.Base_user.status =="Company_Account": # check if user has status 'owner'
|
||||||
return True
|
|
||||||
else:
|
else:
|
||||||
render (request,'upgrade-to-onwer.html')
|
render (request,'upgrade-to-onwer.html')
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class Base_User(AbstractBaseUser,PermissionsMixin):
|
|||||||
is_active = models.BooleanField(default=True)
|
is_active = models.BooleanField(default=True)
|
||||||
|
|
||||||
date_joined = models.DateTimeField(_('Date joined'),auto_now_add=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')
|
status = models.CharField(max_length=32, choices=STATUS, default='BaseAcc')
|
||||||
|
|
||||||
USERNAME_FIELD = 'email'
|
USERNAME_FIELD = 'email'
|
||||||
@ -67,7 +67,7 @@ class NormalUser(models.Model):
|
|||||||
first_name = models.CharField(_('First Name'), max_length=30, blank = False)
|
first_name = models.CharField(_('First Name'), max_length=30, blank = False)
|
||||||
last_name = models.CharField(_('Last 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)
|
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
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user