def save(self, commit=True): project = super(ProjectAdminForm, self).save(commit=False) project.previous_status = self.initial_status if self.initial_status != project.status: update_openldap_project(project) if commit: project.save() return project
def save(self, commit=True): allocation = super(SystemAllocationRequestAdminForm, self).save(commit=False) allocation.previous_status = self.initial_status if self.initial_status != allocation.status: update_openldap_project(allocation) if commit: allocation.save() return allocation
def activate_projects(self, request, queryset): rows_updated = 0 for project in queryset: project.status = Project.APPROVED project.save() update_openldap_project(project) rows_updated += 1 message = self._project_action_message(rows_updated) self.message_user( request, '{message} successfully submitted for activation.'.format( message=message))
def activate_allocations(self, request, queryset): rows_updated = 0 for allocation in queryset: allocation.status = SystemAllocationRequest.APPROVED allocation.save() update_openldap_project(allocation) rows_updated += 1 message = self._allocation_action_message(rows_updated) self.message_user( request, '{message} successfully submitted for activation.'.format( message=message))