AC-132 Added API support to prompt for SCM passwords when updating a project.

This commit is contained in:
Chris Church
2013-08-30 03:08:24 -04:00
parent 08a29f801a
commit 67ae8effa4
4 changed files with 70 additions and 23 deletions

View File

@@ -270,16 +270,16 @@ class ProjectUpdateView(GenericAPIView):
data = dict(
can_update=bool(obj.scm_type),
)
#if obj.scm_type:
# data['passwords_needed_to_update'] = obj.get_passwords_needed_to_start()
if obj.scm_type:
data['passwords_needed_to_update'] = obj.scm_passwords_needed
return Response(data)
def post(self, request, *args, **kwargs):
obj = self.get_object()
if bool(obj.scm_type):
project_update = obj.update()
project_update = obj.update(**request.DATA)
if not project_update:
data = dict(msg='Unable to update project!')
data = dict(passwords_needed_to_update=obj.scm_passwords_needed)
return Response(data, status=status.HTTP_400_BAD_REQUEST)
else:
return Response(status=status.HTTP_202_ACCEPTED)