Commit 55ffd481 authored by Meet Narendra's avatar Meet Narendra 💬

Added file create option

parent ca76d00e
......@@ -180,6 +180,24 @@ class postFileChangeViewSet(views.APIView):
print(e)
return Response({'status':False})
class postFileCreateViewSet(views.APIView):
def post(self,request):
pid = request.data.get('pid')
file = request.data.get('file')
data = request.data.get('data')
try:
project = Projects.objects.filter(pid=pid)
if project is None:
return Response({'status':False})
git_id = project.values('git_id')[0]['git_id']
with open (git_id,'a') as f:
writer = csv.writer(f)
writer.writerow([file,data])
return Response({'status':True})
except Exception as e:
print(e)
return Response({'status':False})
class getUserDetailsViewSet(views.APIView):
def get(self,request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment