|
25 | 25 | from rest_framework.schemas import AutoSchema
|
26 | 26 |
|
27 | 27 | from .filestore import (add_filestore_auth, delete_filestore_user,
|
28 |
| - set_filestore_pass, set_filestore_scope, |
29 |
| - use_filestore_auth) |
| 28 | + is_filestore_user, set_filestore_pass, |
| 29 | + set_filestore_scope, use_filestore_auth) |
30 | 30 | from .forms import (DeviceForm, SceneForm, SocialSignupForm, UpdateDeviceForm,
|
31 | 31 | UpdateSceneForm, UpdateStaffForm)
|
32 | 32 | from .models import Device, Scene
|
@@ -614,10 +614,11 @@ def storelogin(request):
|
614 | 614 | fs_user_token = None
|
615 | 615 | if user.is_authenticated:
|
616 | 616 | # try user auth
|
617 |
| - fs_user_token, status = use_filestore_auth(user) |
618 |
| - if status == 403: # if django allauth pass updated by oauth, update pass |
619 |
| - fs_user_token = set_filestore_pass(user) |
620 |
| - if not fs_user_token: |
| 617 | + if is_filestore_user(user): |
| 618 | + fs_user_token, status = use_filestore_auth(user) |
| 619 | + if status == 403: # if django allauth pass updated by oauth, update pass |
| 620 | + fs_user_token = set_filestore_pass(user) |
| 621 | + elif not fs_user_token: |
621 | 622 | # otherwise user needs to be added
|
622 | 623 | fs_user_token = add_filestore_auth(user)
|
623 | 624 |
|
|
0 commit comments