Skip to content

Commit 12c3eee

Browse files
authored
Merge pull request #1982 from unicef/staging
Staging
2 parents e795d7b + 718e04a commit 12c3eee

File tree

85 files changed

+1307
-1642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1307
-1642
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ deis
9797
env_dev
9898

9999
.env
100+
.envrc
100101

101102
frontend/
102103

src/etools/applications/EquiTrack/data/groups.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,27 +200,24 @@
200200
"fields": {
201201
"name": "Country Office Administrator",
202202
"permissions": [
203-
738,
203+
744,
204204
756,
205-
774,
205+
768,
206206
753,
207-
739,
207+
745,
208208
757,
209-
775,
209+
769,
210210
754,
211-
740,
211+
746,
212212
758,
213-
776,
213+
770,
214214
755,
215-
765,
216-
766,
217-
767,
218-
569,
219-
727,
215+
570,
216+
571,
220217
611,
221218
612,
222219
613,
223-
733,
220+
739,
224221
421,
225222
424,
226223
215,
@@ -229,12 +226,13 @@
229226
446,
230227
447,
231228
448,
229+
326,
232230
209,
233231
210,
234232
211,
235-
762,
236-
763,
237-
764,
233+
765,
234+
766,
235+
767,
238236
452,
239237
453,
240238
454,
@@ -280,8 +278,9 @@
280278
281,
281279
282,
282280
283,
283-
779,
284-
770
281+
783,
282+
784,
283+
785
285284
]
286285
}
287286
}

src/etools/applications/EquiTrack/renderers.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,26 @@ class CSVFlatRenderer(r.CSVRenderer):
66

77

88
class FriendlyCSVRenderer(r.CSVRenderer):
9+
"""Mixin which allow to render boolean value in custom way"""
10+
11+
positive = 'Yes'
12+
negative = ''
13+
914
def flatten_item(self, item):
1015
if isinstance(item, bool):
11-
return {'': {True: 'Yes', False: ''}[item]}
16+
return {'': {True: self.positive, False: self.negative}[item]}
1217
return super().flatten_item(item)
18+
19+
20+
class ListSeperatorCSVRenderMixin(object):
21+
"""Mixin which render list concatenating them usign the separator"""
22+
23+
separator = '\n\n'
24+
25+
def flatten_item(self, item):
26+
if isinstance(item, list):
27+
return {'': self.clean_list(item)}
28+
return super().flatten_item(item)
29+
30+
def clean_list(self, list_item):
31+
return self.separator.join(list_item)

0 commit comments

Comments
 (0)