Example #1
0
 def post(self, request, *args, **kwargs):
     fill_form = VacancyRegistrationForm(request.POST or None, request.FILES)
     project = Project.get_by_name(request.GET['groupName'])
     if fill_form.try_save_vacancy(request.user, project):
         return JsonResponse(self.json_answer_if_success())
     else:
         return JsonResponse(self.json_answer_if_fail(request, fill_form))
Example #2
0
 def get(self, request, *args, **kwargs):
     group_name = request.GET['groupName']
     project = Project.get_by_name(request.GET['groupName'])
     starting_values = Membership.all_active_workers(project)
     c = self.init_context(request, group_name, 'Edit members')
     c.update({'formset': self.doc_formset_container(queryset=starting_values),
               'helper': FormSetHelper()})
     return render(request, 'registration/registration_formset.html', c)
Example #3
0
 def test_finishing(self):
     project = Project(start_date='2011-01-01', end_date=None)
     project |should_not| be_finished
     project.end_date = '2011-01-31'
     project |should| be_finished
Example #4
0
 def test_change_status_to_finished(self):
     project = Project(start_date='2011-01-01', end_date=None)
     project |should_not| be_finished
     project.end_date = '2011-01-31'
     project.save()
     project.status |should| equal_to('finalizado')
Example #5
0
 def save_form(cls, fill_form, request):
     event = fill_form.save(commit=False)
     event.project = Project.get_by_name(request.GET['groupName'])
     event.save()