Skip to content

Commit c77f082

Browse files
committed
Take pre_moderated on group creation
1 parent 2da2bb2 commit c77f082

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

h/views/api/groups.py

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def create(request):
6868
"userid": request.user.userid,
6969
"description": appstruct.get("description", None),
7070
"groupid": groupid,
71+
"pre_moderated": appstruct.get("pre_moderated", False),
7172
}
7273

7374
if group_type == "private":

tests/unit/h/views/api/groups_test.py

+9
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ def test_it_when_request_json_body_is_invalid(
9090
"name": sentinel.name,
9191
"description": sentinel.description,
9292
"type": "private",
93+
"pre_moderated": False,
9394
},
9495
call.create_private_group(
9596
name=sentinel.name,
9697
userid=sentinel.userid,
9798
description=sentinel.description,
9899
groupid=None,
100+
pre_moderated=False,
99101
),
100102
),
101103
(
@@ -105,6 +107,7 @@ def test_it_when_request_json_body_is_invalid(
105107
userid=sentinel.userid,
106108
description=None,
107109
groupid=None,
110+
pre_moderated=False,
108111
),
109112
),
110113
],
@@ -136,13 +139,15 @@ def test_create_private_group(
136139
"name": sentinel.name,
137140
"description": sentinel.description,
138141
"type": "restricted",
142+
"pre_moderated": True,
139143
},
140144
call.create_restricted_group(
141145
name=sentinel.name,
142146
userid=sentinel.userid,
143147
scopes=[],
144148
description=sentinel.description,
145149
groupid=None,
150+
pre_moderated=True,
146151
),
147152
),
148153
(
@@ -153,6 +158,7 @@ def test_create_private_group(
153158
scopes=[],
154159
description=None,
155160
groupid=None,
161+
pre_moderated=False,
156162
),
157163
),
158164
],
@@ -183,13 +189,15 @@ def test_create_restricted_group(
183189
"name": sentinel.name,
184190
"description": sentinel.description,
185191
"type": "open",
192+
"pre_moderated": True,
186193
},
187194
call.create_open_group(
188195
name=sentinel.name,
189196
userid=sentinel.userid,
190197
scopes=[],
191198
description=sentinel.description,
192199
groupid=None,
200+
pre_moderated=True,
193201
),
194202
),
195203
(
@@ -200,6 +208,7 @@ def test_create_restricted_group(
200208
scopes=[],
201209
description=None,
202210
groupid=None,
211+
pre_moderated=False,
203212
),
204213
),
205214
],

0 commit comments

Comments
 (0)