Changeset ca9e802 for asadb/groups/diffs.py
- Timestamp:
- Nov 5, 2012, 4:23:58 AM (13 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- 1f48e70
- Parents:
- bbc8f73
- git-author:
- Alex Dehnert <adehnert@…> (11/05/12 04:23:58)
- git-committer:
- Alex Dehnert <adehnert@…> (11/05/12 04:23:58)
- File:
-
- 1 edited
-
asadb/groups/diffs.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
asadb/groups/diffs.py
r9882429 rca9e802 243 243 244 244 245 def default_active_pred(): 246 status_objs = groups.models.GroupStatus.objects.filter(slug__in=['active', 'suspended', 'nge']) 247 status_pks = [status.pk for status in status_objs] 248 def pred(version, fields): 249 return fields['group_status'] in status_pks 250 return pred 251 245 252 def funded_pred(funding_slug): 246 253 classes = groups.models.GroupClass.objects … … 248 255 fundings = groups.models.GroupFunding.objects 249 256 fund_pk = fundings.get(slug=funding_slug).pk 257 active_pred = default_active_pred() 250 258 def pred(version, fields): 251 return fields['group_class'] == class_pk and fields['group_funding'] == fund_pk259 return active_pred(version, fields) and fields['group_class'] == class_pk and fields['group_funding'] == fund_pk 252 260 return pred 253 261 … … 291 299 sao_callback.care_about_groups = False 292 300 callbacks.append(sao_callback) 293 callbacks.append(UpdateOfficerListCallback(asa_all_groups_list)) 301 callbacks.append(UpdateOfficerListCallback( 302 listobj=asa_all_groups_list, 303 include_pred=default_active_pred(), 304 )) 294 305 callbacks.append(UpdateOfficerListCallback( 295 306 listobj=finboard_groups_list,
Note: See TracChangeset
for help on using the changeset viewer.