@@ -144,6 +144,7 @@ class Meta:
144144 fields = (
145145 'start_date' , 'end_date' , 'role' , 'type' , 'country_from' , 'country_to' ,
146146 'deployment' , 'molnix_id' , 'molnix_tags' , 'is_active' , 'id' ,
147+ 'surge_alert_id' ,
147148 'name' , # plus
148149 )
149150
@@ -160,6 +161,7 @@ class Meta:
160161 fields = (
161162 'start_date' , 'end_date' , 'role' , 'type' , 'country_from' , 'country_to' ,
162163 'deployment' , 'molnix_id' , 'molnix_tags' , 'is_active' , 'id' ,
164+ 'surge_alert_id' ,
163165 )
164166
165167
@@ -175,10 +177,12 @@ class Meta:
175177 fields = (
176178 'start_date' , 'end_date' , 'role' , 'type' , 'country_from' , 'country_to' ,
177179 'deployment' , 'molnix_id' , 'molnix_tags' , 'is_active' , 'id' ,
180+ 'surge_alert_id' ,
178181 'name' , 'molnix_status' , # 2 plus
179182 )
180183
181184
185+ # Don't forget to adapt drf_views::get_renderer_context if you change this:
182186class PersonnelCsvSerializerBase (ModelSerializer ):
183187 country_from = NanoCountrySerializer ()
184188 country_to = NanoCountrySerializer ()
@@ -194,6 +198,7 @@ class PersonnelCsvSerializerBase(ModelSerializer):
194198 inactive_status = serializers .SerializerMethodField ()
195199 start_date = serializers .SerializerMethodField ()
196200 end_date = serializers .SerializerMethodField ()
201+ surge_alert_id = serializers .SerializerMethodField ()
197202
198203 @staticmethod
199204 def get_start_date (obj ):
@@ -242,6 +247,10 @@ def get_ongoing(obj):
242247 end = obj .end_date if obj .end_date else today
243248 return start <= today <= end
244249
250+ @staticmethod
251+ def get_surge_alert_id (obj ):
252+ return obj .surge_alert_id
253+
245254
246255# 3 versions: a "regular", an Anon(yme) and a Super(user) class:
247256class PersonnelCsvSerializer (PersonnelCsvSerializerBase ):
@@ -256,6 +265,7 @@ class Meta:
256265 'deployment' , 'id' , 'is_active' , 'molnix_sector' , 'molnix_id' ,
257266 'molnix_role_profile' , 'molnix_language' , 'molnix_region' , 'molnix_scope' ,
258267 'molnix_modality' , 'molnix_operation' , 'ongoing' , 'inactive_status' ,
268+ 'surge_alert_id' ,
259269 )
260270
261271
@@ -270,6 +280,7 @@ class Meta:
270280 'deployment' , 'id' , 'is_active' , 'molnix_sector' , 'molnix_id' ,
271281 'molnix_role_profile' , 'molnix_language' , 'molnix_region' , 'molnix_scope' ,
272282 'molnix_modality' , 'molnix_operation' , 'ongoing' , 'inactive_status' ,
283+ 'surge_alert_id' ,
273284 )
274285
275286
@@ -286,6 +297,7 @@ class Meta:
286297 'molnix_status' , # plus
287298 'molnix_role_profile' , 'molnix_language' , 'molnix_region' , 'molnix_scope' ,
288299 'molnix_modality' , 'molnix_operation' , 'ongoing' , 'inactive_status' ,
300+ 'surge_alert_id' ,
289301 )
290302
291303
0 commit comments