Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 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))
Ejemplo n.º 4
0
 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))