django-restit 4.2.20__py3-none-any.whl → 4.2.22__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/session.py CHANGED
@@ -9,9 +9,10 @@ from rest import ua
9
9
  class AuthSession(models.Model, RestModel):
10
10
  class RestMeta:
11
11
  SEARCH_FIELDS = ["ip", "member__username", "browser", "location__city"]
12
- VIEW_PERMS = ["view_members", "manage_members", "manage_users"]
12
+ VIEW_PERMS = ["view_members", "manage_members", "manage_users", "owner"]
13
13
  CAN_SAVE = False
14
14
  CAN_DELETE = False
15
+ VIEW_PERMS_MEMBER_FIELD = "member"
15
16
  # note the | will check collection parameter...
16
17
  # trailing "." will check if the collection has the key set to true
17
18
  SEARCH_TERMS = [
account/rpc/auth.py CHANGED
@@ -241,6 +241,20 @@ def is_member_logged_in(request):
241
241
  return rv.restStatus(request, False)
242
242
 
243
243
 
244
+ @rd.urlPOST('invite/validate')
245
+ @rd.never_cache
246
+ def member_invite_confirm(request):
247
+ username = request.DATA.get('username', None)
248
+ auth_code = request.DATA.get(["auth_token", "invite_token"], None)
249
+ member = getMemberByUsername(username)
250
+ if not member or not auth_code:
251
+ return rv.restPermissionDenied(request, error=f"Username or code is incorrect {username}/{auth_code}", error_code=422)
252
+ auth_code = auth_code.replace('-', '').replace(' ', '')
253
+ if member.auth_code is None or member.auth_code != auth_code:
254
+ return rv.restStatus(request, False)
255
+ return rv.restStatus(request, True)
256
+
257
+
244
258
  @rd.urlPOST('mfa/request_code')
245
259
  @rd.never_cache
246
260
  def member_request_code(request):
account/rpc/oauth.py CHANGED
@@ -70,4 +70,12 @@ def oauth_google_login(request):
70
70
  member.auditLog("user succesfully authenticated with google", "google_oauth", level=17)
71
71
 
72
72
  params = urlencode({'oauth_code': member.auth_code, "username":member.username})
73
- return redirect(f"{app_url}?{params}")
73
+ rurl = None
74
+ if "?" in app_url:
75
+ if app_url[-1] == "?":
76
+ rurl = f"{app_url}{params}"
77
+ else:
78
+ rurl = f"{app_url}&{params}"
79
+ else:
80
+ rurl = f"{app_url}?{params}"
81
+ return redirect(rurl)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-restit
3
- Version: 4.2.20
3
+ Version: 4.2.22
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -28,7 +28,7 @@ account/models/member.py,sha256=Vv2z3QNzY201OvIRjo8tIPi4mv_T1YCuBfeRAhakRbg,4962
28
28
  account/models/membership.py,sha256=Qmp0xQa_3ObB581L83gce69t9eSfyH-mZZuGqW3ueI8,7763
29
29
  account/models/notify.py,sha256=YnZujSHJHY7B09e6FIyZIEJRWLPYk1Sk1e92tFzB1IA,12078
30
30
  account/models/passkeys.py,sha256=TJxITUi4DT4_1tW2K7ZlOcRjJuMVl2NtKz7pKQU8-Tw,1516
31
- account/models/session.py,sha256=swhxcx_lWzOpGCmfifXoACgWYqmKmS7eZsD9s9jSToc,3509
31
+ account/models/session.py,sha256=iN9x9hi0LyB_2giT__YuqwbClQ7Ae8Gb4bhGph_qD6Q,3561
32
32
  account/models/settings.py,sha256=gOyRWBVd3BQpjfj_hJPtqX3H46ztyRAFxBrPbv11lQg,2137
33
33
  account/oauth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  account/oauth/google.py,sha256=q5M6Qhpfp9QslKRVYFZBvtG6kgXV6vYMrR5fp6Xdb9I,2078
@@ -36,12 +36,12 @@ account/passkeys/__init__.py,sha256=FwXYJXwSJXfkLojGBcVpF1dFpgFhzDdd9N_3naYQ0cc,
36
36
  account/passkeys/core.py,sha256=X8y1TCXupZZV-GF10nuPVmdpN0qYuzKe03RnaDlepP4,4116
37
37
  account/periodic.py,sha256=-u0n-7QTJgDOkasGhBAPwHAwjpqWGA-MZLEFkVTqCGU,874
38
38
  account/rpc/__init__.py,sha256=SGF0M_-H0dKh3b1apSX29BotNWAvITYccGQVC0MIjL8,336
39
- account/rpc/auth.py,sha256=hINQS6BC04tZS5G0A-XXn2zAWxjWnba0l3zKNKZUsJM,14934
39
+ account/rpc/auth.py,sha256=vde9ELpqjkg1oY5B0Xa3qghNZ8brqCUgEx-K5rM6AzQ,15557
40
40
  account/rpc/device.py,sha256=fbbZFp3cUdhVXvD7gVFOqFWj4hKS3bjZKD_aF5fQxd8,2852
41
41
  account/rpc/group.py,sha256=Y_Ii-vlDx09neMd95AmC7xBwDf3wdFgXjB-kIG2jMdE,3472
42
42
  account/rpc/member.py,sha256=2HwARWk_1HHgZga3Y0Ii2NoTyzj1e3BuHpQ5miUQmCI,1260
43
43
  account/rpc/notify.py,sha256=Q2YWejP36egeF060Hih5uX4Psv_B8NWlLLPi7iDYlIw,3344
44
- account/rpc/oauth.py,sha256=qhXgrGrmg966_WTg7c4ZuldgWZEaub0dI3u102vX0wg,2669
44
+ account/rpc/oauth.py,sha256=ISLVsR5HvKALANokaOFRvF4FTRxWtXPvVnZAYANKxpo,2864
45
45
  account/rpc/passkeys.py,sha256=5x28nYILJUMMSwfVuWYL66hfoGUXahMqOwiHhM4I3Do,1729
46
46
  account/rpc/settings.py,sha256=EvPuwW63Gp_Va0ANIPAZ894tnS_JCctQ0FzqYRdKUNM,271
47
47
  account/settings.py,sha256=XEvZdcA6p_iUpDq9NmICK8rxzIQ8NViKfrpyuYgSV4o,53
@@ -358,7 +358,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
358
358
  rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
359
359
  rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
360
360
  rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
361
- rest/__init__.py,sha256=-FakvBC0-QieiJJMso9B3FvxnxbuAJeVL_fMjk-UIN8,121
361
+ rest/__init__.py,sha256=69hUtntzRnpHlb7egaumCf6Rm_xMzmqQOClqHf-WOgQ,121
362
362
  rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
363
363
  rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
364
364
  rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
@@ -490,7 +490,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
490
490
  ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
491
491
  ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
492
492
  ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
493
- django_restit-4.2.20.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
494
- django_restit-4.2.20.dist-info/METADATA,sha256=UtbUegniblxmh572KXGbomXEmNA_HKxH_vFgHztOH6E,7594
495
- django_restit-4.2.20.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
496
- django_restit-4.2.20.dist-info/RECORD,,
493
+ django_restit-4.2.22.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
494
+ django_restit-4.2.22.dist-info/METADATA,sha256=-H_cLUXvcOIL_YRfRNIBnpOfRwrpDmC_g0uFsbGcPWI,7594
495
+ django_restit-4.2.22.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
496
+ django_restit-4.2.22.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.20"
4
+ __version__ = "4.2.22"