django-restit 4.2.34__py3-none-any.whl → 4.2.36__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 +7 -7
- account/rpc/group.py +7 -0
- {django_restit-4.2.34.dist-info → django_restit-4.2.36.dist-info}/METADATA +1 -1
- {django_restit-4.2.34.dist-info → django_restit-4.2.36.dist-info}/RECORD +8 -8
- rest/__init__.py +1 -1
- rest/serializers/collection.py +1 -1
- {django_restit-4.2.34.dist-info → django_restit-4.2.36.dist-info}/LICENSE.md +0 -0
- {django_restit-4.2.34.dist-info → django_restit-4.2.36.dist-info}/WHEEL +0 -0
account/models/member.py
CHANGED
@@ -494,24 +494,24 @@ class Member(User, RestModel, MetaDataModel):
|
|
494
494
|
if notify:
|
495
495
|
Member.notifyWithPermission("user_audit", subject, message=body, email_only=True)
|
496
496
|
|
497
|
-
def enable(self, by, memberships=None):
|
497
|
+
def enable(self, by, memberships=None, notify=True):
|
498
498
|
if not self.is_active:
|
499
499
|
self.is_active = True
|
500
500
|
self.save()
|
501
|
-
# notify account disabled
|
502
|
-
subject = "MEMBER {} RE-ENABLED BY {}".format(self, by)
|
503
|
-
body = "enabled for: "
|
504
501
|
if memberships is None:
|
505
502
|
memberships = self.memberships.all()
|
506
|
-
|
507
503
|
accounts = []
|
508
504
|
for m in memberships:
|
509
505
|
m.state = 10
|
510
506
|
m.save()
|
511
507
|
accounts.append(m.group.name)
|
512
|
-
body += "<br>\n".join(accounts)
|
513
508
|
self.log("enabled", "account enabled by {}".format(by.username), method="enabled", level=35)
|
514
|
-
|
509
|
+
if notify:
|
510
|
+
# notify account disabled
|
511
|
+
subject = f"MEMBER {self.username} RE-ENABLED BY {by.username}"
|
512
|
+
body = "enabled for: "
|
513
|
+
body += "<br>\n".join(accounts)
|
514
|
+
Member.notifyWithPermission("user_audit", subject, message=body, email_only=True)
|
515
515
|
|
516
516
|
def locateByIP(self, ip):
|
517
517
|
loc = GeoIP.get(ip)
|
account/rpc/group.py
CHANGED
@@ -59,6 +59,13 @@ def rest_on_group_invite(request, group_id=None):
|
|
59
59
|
if ms is None:
|
60
60
|
member.auditLog(f"added to {group.name}:{group.id} by {request.member.username}", "group_invite", level=21)
|
61
61
|
ms = group.invite(member, request.DATA.get("role", "guest"))
|
62
|
+
elif not ms.is_enabled:
|
63
|
+
# re-enable the member if they are being re-invited after being disabled
|
64
|
+
if not ms.member.is_active:
|
65
|
+
# we need to make sure we only enable the user for this group
|
66
|
+
ms.member.enable(request.member, memberships=[], notify=False)
|
67
|
+
ms.set_state(0)
|
68
|
+
ms.save()
|
62
69
|
ms.auditLog(f"invite sent by {request.member.username}", "invite", level=21)
|
63
70
|
ms.sendInvite(request)
|
64
71
|
return ms.restGet(request)
|
@@ -24,7 +24,7 @@ account/models/device.py,sha256=XipNpByreGubB5-d4ZBOoIV5Xw14b2Btcgn6fXz8HAc,4105
|
|
24
24
|
account/models/feeds.py,sha256=FXqcZ1Qy4oYOLzai7-GL4WNd7iKPb5Y3ZqvKQunq1Yk,1861
|
25
25
|
account/models/group.py,sha256=krFO_Q7kas6j36eYIVpOalLkNfWd1Mj4IniPgENJay4,20628
|
26
26
|
account/models/legacy.py,sha256=zYdtv4LC0ooxPVqWM-uToPwV-lYWQLorSE6p6yn1xDw,2720
|
27
|
-
account/models/member.py,sha256=
|
27
|
+
account/models/member.py,sha256=XwT4evwN6_THL2bKb_TjtQg7NWNwQqtotMHLScplv1s,50188
|
28
28
|
account/models/membership.py,sha256=K2fd0TJYhfv58HPyjQVlahlOPz3Q6ZwrxVkguG-2Ej8,7806
|
29
29
|
account/models/notify.py,sha256=YnZujSHJHY7B09e6FIyZIEJRWLPYk1Sk1e92tFzB1IA,12078
|
30
30
|
account/models/passkeys.py,sha256=TJxITUi4DT4_1tW2K7ZlOcRjJuMVl2NtKz7pKQU8-Tw,1516
|
@@ -38,7 +38,7 @@ account/periodic.py,sha256=-u0n-7QTJgDOkasGhBAPwHAwjpqWGA-MZLEFkVTqCGU,874
|
|
38
38
|
account/rpc/__init__.py,sha256=SGF0M_-H0dKh3b1apSX29BotNWAvITYccGQVC0MIjL8,336
|
39
39
|
account/rpc/auth.py,sha256=eywdJSjsi_Ds2pM4wnltPJUfjIQqf6r6e99eKS7q3BA,15593
|
40
40
|
account/rpc/device.py,sha256=fbbZFp3cUdhVXvD7gVFOqFWj4hKS3bjZKD_aF5fQxd8,2852
|
41
|
-
account/rpc/group.py,sha256=
|
41
|
+
account/rpc/group.py,sha256=JFOTgAbxtpmNmJIMb9Gqesd4y_31Sv9G6atkRoNylqs,3802
|
42
42
|
account/rpc/member.py,sha256=PU-Uz5KUI_BZFy-F-taDqAfnt_AwONYXSzUvfm7eyTw,1264
|
43
43
|
account/rpc/notify.py,sha256=Q2YWejP36egeF060Hih5uX4Psv_B8NWlLLPi7iDYlIw,3344
|
44
44
|
account/rpc/oauth.py,sha256=ISLVsR5HvKALANokaOFRvF4FTRxWtXPvVnZAYANKxpo,2864
|
@@ -359,7 +359,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
359
359
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
360
360
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
361
361
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
362
|
-
rest/__init__.py,sha256=
|
362
|
+
rest/__init__.py,sha256=iVIqAE0As5bshnuxR1o0_pekm6J0wzokoNe-dvn7ps8,121
|
363
363
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
364
364
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
365
365
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -400,7 +400,7 @@ rest/requestex.py,sha256=dYXDIg1TLu44FYFjR9X-6AAr7E5yeeGySrlEBC7ZOcU,15677
|
|
400
400
|
rest/rpc.py,sha256=Z-0Q62VeMViZiS_9vBHKJmbERgemsfg8pnKFjV-DH-w,4200
|
401
401
|
rest/search.py,sha256=QVjk2b5tZLgf1zM2MHvJTyRjwUbY5ZD7HXSTmSPXtvU,8362
|
402
402
|
rest/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
403
|
-
rest/serializers/collection.py,sha256=
|
403
|
+
rest/serializers/collection.py,sha256=V9O4qxw26VX9dSYdbsN0-RNnXEi347Ln8eFLZ003LhA,4646
|
404
404
|
rest/serializers/csv.py,sha256=MUMqGyAcKAtYblNiLMyeRKUr6kmthVEfAoM4iUTNvPA,3251
|
405
405
|
rest/serializers/excel.py,sha256=KtxqZZU5Huzo31tyVVWbshMudeSAImKLO71ufQQt0-c,1077
|
406
406
|
rest/serializers/json.py,sha256=R1has2PZQuXacA6WwfdrBnMG4rSM6CrnXQOhGoAU6Dk,1736
|
@@ -491,7 +491,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
491
491
|
ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
|
492
492
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
493
493
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
494
|
-
django_restit-4.2.
|
495
|
-
django_restit-4.2.
|
496
|
-
django_restit-4.2.
|
497
|
-
django_restit-4.2.
|
494
|
+
django_restit-4.2.36.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
495
|
+
django_restit-4.2.36.dist-info/METADATA,sha256=1PHMY2EOnFkwqFCIW8cEdj7UVpz_MukIYWjHR_T4NWI,7594
|
496
|
+
django_restit-4.2.36.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
497
|
+
django_restit-4.2.36.dist-info/RECORD,,
|
rest/__init__.py
CHANGED
rest/serializers/collection.py
CHANGED
@@ -72,7 +72,7 @@ def to_list(qset, sort=None, size=25, start=0, fields=[], extra=[], exclude=[],
|
|
72
72
|
qset, sort_args = sort_list(qset, sort)
|
73
73
|
output["sort"] = sort_args
|
74
74
|
|
75
|
-
qset = qset[start:start+size
|
75
|
+
qset = qset[start:start+size]
|
76
76
|
if not fields:
|
77
77
|
fields = ms.get_fields(qset)
|
78
78
|
if settings.REST_SELECT_RELATED:
|
File without changes
|
File without changes
|