File tree 1 file changed +32
-1
lines changed
1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,35 @@ def list_applications(
22
22
dict: list applications
23
23
"""
24
24
params : dict [str , Any ] = {key : value for key , value in locals ().items () if value is not None and key != "self" }
25
- return self ._requestor .api (Request .GET , "/admin/registration_application/list" , params = params )
25
+ return self ._requestor .api (Request .GET , "/admin/registration_application/list" , params = params )
26
+
27
+ def process_application (
28
+ self ,
29
+ user_id : int ,
30
+ approve : Optional [bool ] = True ,
31
+ deny_reason : Optional [str ] = None
32
+ ) -> Optional [dict ]:
33
+ """
34
+ Accept or deny a specific user application. Note user must be admin.
35
+
36
+ Args:
37
+ user_id (int): The user id.
38
+ approve (Optional[bool], optional): Defaults to True.
39
+ deny_reason (Optional[str]): Defaults to None.
40
+ Returns:
41
+ Optional[dict]: application data if successful
42
+ """
43
+
44
+ process_application = {
45
+ "id" : user_id ,
46
+ "approve" : approve ,
47
+ }
48
+
49
+ if deny_reason is not None :
50
+ process_application ["deny_reason" ] = deny_reason
51
+
52
+ return self ._requestor .api (
53
+ Request .PUT ,
54
+ "/admin/registration_application/approve" ,
55
+ json = process_application
56
+ )
You can’t perform that action at this time.
0 commit comments