django-restit 4.2.5__py3-none-any.whl → 4.2.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
account/models/member.py CHANGED
@@ -296,7 +296,9 @@ class Member(User, RestModel, MetaDataModel):
296
296
  if not self.is_active:
297
297
  self.log("login_blocked", F"account is not active {self.username}", request, method="login", level=31)
298
298
  if throw_exception:
299
- raise PermissionDeniedException("Account disabled", 410)
299
+ if request is not None:
300
+ request.member = self
301
+ raise PermissionDeniedException(f"{self.username} Account disabled", 410)
300
302
  return False
301
303
  if self.is_blocked:
302
304
  self.log("login_blocked", F"account is locked out {self.username}", request, method="login", level=31)
account/rpc/auth.py CHANGED
@@ -111,7 +111,7 @@ def jwt_refresh(request):
111
111
  return rv.restPermissionDenied(request, error="invalid token", error_code=-702)
112
112
  if member.security_token is None:
113
113
  member.refreshSecurityToken()
114
- member.canLogin()
114
+ member.canLogin(request)
115
115
  token.refresh()
116
116
  request.jwt_token = token.access_token # this tells the middleware to store in cookie
117
117
  return rv.restGet(request, dict(access=token.access_token, refresh=token.refresh_token))
@@ -260,11 +260,11 @@ def get_member_from_request(request):
260
260
  if not member.is_active:
261
261
  request.member = member
262
262
  member.log("login_blocked", "account is not active", request, method="login", level=31)
263
- return member, rv.restPermissionDenied(request, error="Account disabled", error_code=410)
263
+ return member, rv.restPermissionDenied(request, error=f"{member.username} Account disabled", error_code=410)
264
264
  if member.is_blocked:
265
265
  request.member = member
266
266
  member.log("login_blocked", "account is locked out", request, method="login", level=31)
267
- return member, rv.restPermissionDenied(request, error="Account locked out", error_code=411)
267
+ return member, rv.restPermissionDenied(request, error=f"{member.username} Account locked out", error_code=411)
268
268
  return member, None
269
269
 
270
270
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-restit
3
- Version: 4.2.5
3
+ Version: 4.2.6
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -23,7 +23,7 @@ account/models/device.py,sha256=XipNpByreGubB5-d4ZBOoIV5Xw14b2Btcgn6fXz8HAc,4105
23
23
  account/models/feeds.py,sha256=4n4Mv8HjcXpUmMPWafHlsGbVQ1fDKdtblL1hp30sDrg,1437
24
24
  account/models/group.py,sha256=jj4csGHDyDRMS_maL8AeV1k3whSxBdeffHxmnXrn-sg,20064
25
25
  account/models/legacy.py,sha256=zYdtv4LC0ooxPVqWM-uToPwV-lYWQLorSE6p6yn1xDw,2720
26
- account/models/member.py,sha256=5e-odISpgas7M4ZEqdNqAQwAWrdWG3lhgZDh0rNvdBs,48938
26
+ account/models/member.py,sha256=5y8Reo5Cc0opKrDsd4XJz22fhZoy3_EmE93qPl4649Y,49037
27
27
  account/models/membership.py,sha256=Qmp0xQa_3ObB581L83gce69t9eSfyH-mZZuGqW3ueI8,7763
28
28
  account/models/notify.py,sha256=YnZujSHJHY7B09e6FIyZIEJRWLPYk1Sk1e92tFzB1IA,12078
29
29
  account/models/session.py,sha256=swhxcx_lWzOpGCmfifXoACgWYqmKmS7eZsD9s9jSToc,3509
@@ -32,7 +32,7 @@ account/oauth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  account/oauth/google.py,sha256=q5M6Qhpfp9QslKRVYFZBvtG6kgXV6vYMrR5fp6Xdb9I,2078
33
33
  account/periodic.py,sha256=-u0n-7QTJgDOkasGhBAPwHAwjpqWGA-MZLEFkVTqCGU,874
34
34
  account/rpc/__init__.py,sha256=L_AqHC0WbgUgLoqvNz6pY0E34eqh7sRaX77I6TxhRZ4,152
35
- account/rpc/auth.py,sha256=qIxbzqaeacq-boMlw0j7zMgzhONag3Jjrld1hBohdag,14851
35
+ account/rpc/auth.py,sha256=twt0gMHVZgKX3aV5oN5K_1jXpRoOH9_ckDeA9nd0Tsk,14896
36
36
  account/rpc/device.py,sha256=fbbZFp3cUdhVXvD7gVFOqFWj4hKS3bjZKD_aF5fQxd8,2852
37
37
  account/rpc/group.py,sha256=Y_Ii-vlDx09neMd95AmC7xBwDf3wdFgXjB-kIG2jMdE,3472
38
38
  account/rpc/member.py,sha256=oKdXSGhQ7AOPTwisZ5RvHhQ1SdZoXWlBQY0lIlDXJY0,1150
@@ -352,7 +352,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
352
352
  rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
353
353
  rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
354
354
  rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
355
- rest/__init__.py,sha256=Zu9wp7F1FP7_VZn3wR7vxntQyaovgJ5zWGp0OTRHvYs,120
355
+ rest/__init__.py,sha256=_aTspOWQgQGORnkd-w0Qm6O_8KEmxZnKx5BO5x-mhkc,120
356
356
  rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
357
357
  rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
358
358
  rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
@@ -484,7 +484,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
484
484
  ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
485
485
  ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
486
486
  ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
487
- django_restit-4.2.5.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
488
- django_restit-4.2.5.dist-info/METADATA,sha256=RKpRp5Pt4ZaAYDdUI6ep9fzZK8G4YjQ779sb-g9GVvc,7572
489
- django_restit-4.2.5.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
490
- django_restit-4.2.5.dist-info/RECORD,,
487
+ django_restit-4.2.6.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
488
+ django_restit-4.2.6.dist-info/METADATA,sha256=-tZKn_1-IB0BehL-M7bNaQTy_YnoBt_l83j4hpyRYiM,7572
489
+ django_restit-4.2.6.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
490
+ django_restit-4.2.6.dist-info/RECORD,,
rest/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .uberdict import UberDict # noqa: F401
2
2
  from .settings_helper import settings # noqa: F401
3
3
 
4
- __version__ = "4.2.5"
4
+ __version__ = "4.2.6"