Merge branch 'II'
This commit is contained in:
commit
93baf9d8b0
4 files changed
+22
-16
No files matched your search
@@ -25,6 +25,7 @@ class MyTokenObtainPairSerializer(TokenObtainPairSerializer):
|
|||||||
token['user']=model_to_dict(user.userinfo)
|
token['user']=model_to_dict(user.userinfo)
|
||||||
token['user']['is_active']=user.is_active
|
token['user']['is_active']=user.is_active
|
||||||
token['user']['is_staff']=user.is_staff
|
token['user']['is_staff']=user.is_staff
|
||||||
|
# !ТУТ СДЕЛАТь ФОТО НАВЕРНОЕ
|
||||||
# token['user']['last_login']= user.last_login
|
# token['user']['last_login']= user.last_login
|
||||||
return token
|
return token
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ class CustomAuth(ModelBackend):
|
|||||||
password = kwargs['password']
|
password = kwargs['password']
|
||||||
status_code=0
|
status_code=0
|
||||||
# !ТУт стучим в AD, потом к Алексею
|
# !ТУт стучим в AD, потом к Алексею
|
||||||
if settings.DEBUG!=True:
|
if settings.myDEBUG!=True:
|
||||||
resp= requests.post('http://10.252.44.13:8005/getAD', json.dumps({'user': username, 'password':password, 'usercheck': username}))
|
resp= requests.post('http://10.252.44.13:8005/getAD', json.dumps({'user': username, 'password':password, 'usercheck': username}))
|
||||||
|
|
||||||
# if True:
|
# if True:
|
||||||
|
|||||||
+6
-9
@@ -51,11 +51,12 @@ class UserManager(BaseUserManager):
|
|||||||
|
|
||||||
|
|
||||||
class User(AbstractBaseUser, PermissionsMixin):
|
class User(AbstractBaseUser, PermissionsMixin):
|
||||||
username = models.CharField(db_index=True, max_length=255, unique=True, verbose_name='Имя пользователя')
|
password = models.CharField(max_length=128, null=True,blank=True)
|
||||||
is_active = models.BooleanField(default=True, verbose_name='Доступ')
|
username = models.CharField(db_index=True, max_length=255, unique=True)
|
||||||
is_staff = models.BooleanField(default=False, verbose_name='Персонал')
|
is_active = models.BooleanField(default=True)
|
||||||
created_at = models.DateTimeField(auto_now_add=True, verbose_name='Дата регистрации')
|
is_staff = models.BooleanField(default=False)
|
||||||
updated_at = models.DateTimeField(auto_now=True, verbose_name='Обновлено')
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
# last_login = models.DateTimeField(auto_now=True, null=True)
|
# last_login = models.DateTimeField(auto_now=True, null=True)
|
||||||
# external=models.ForeignKey(DictEmployee,db_constraint=False, null=True, on_delete=models.PROTECT)
|
# external=models.ForeignKey(DictEmployee,db_constraint=False, null=True, on_delete=models.PROTECT)
|
||||||
objects = UserManager()
|
objects = UserManager()
|
||||||
@@ -66,7 +67,3 @@ class User(AbstractBaseUser, PermissionsMixin):
|
|||||||
|
|
||||||
def fio(self):
|
def fio(self):
|
||||||
return DictEmployee.objects.using('user_directory').get(login=self.username).fio
|
return DictEmployee.objects.using('user_directory').get(login=self.username).fio
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name='Пользователя'
|
|
||||||
verbose_name_plural='Пользователи'
|
|
||||||
BIN
Binary file not shown.
@@ -28,17 +28,25 @@ export function getfromserver(path, reactive){
|
|||||||
|
|
||||||
|
|
||||||
export function checkremote(filecheck){
|
export function checkremote(filecheck){
|
||||||
axiosApiInstance.get(filecheck).then(result => {
|
return filecheck
|
||||||
console.log(result, '-------------');
|
// try{
|
||||||
}).catch(e=>{
|
// let http = new XMLHttpRequest();
|
||||||
return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"
|
// http.open('HEAD', filecheck, false);
|
||||||
})
|
// http.send();
|
||||||
|
// console.log(http.status)
|
||||||
|
// return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"
|
||||||
|
// }
|
||||||
|
// catch(e){
|
||||||
|
// return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"
|
||||||
|
// }
|
||||||
// let tmp = new Image
|
// let tmp = new Image
|
||||||
// tmp.src=filecheck
|
// tmp.src=filecheck
|
||||||
// if(tmp.complete){
|
// if(tmp.complete){
|
||||||
// return filecheck
|
// return filecheck
|
||||||
// }
|
// }
|
||||||
// else {return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"}
|
// else {
|
||||||
|
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user