该视频本人观看信息bug
This commit is contained in:
parent
c6ac2434e8
commit
91b7e692ed
|
@ -81,7 +81,7 @@ class MyViewRecordAPIView(APIView):
|
||||||
video = Video.objects.get(pk=id)
|
video = Video.objects.get(pk=id)
|
||||||
except:
|
except:
|
||||||
return Response('视频不存在', status=HTTP_400_BAD_REQUEST)
|
return Response('视频不存在', status=HTTP_400_BAD_REQUEST)
|
||||||
record = ViewRecord.objects.get_or_create(video=video, user=request.user, defaults={'video':video, 'user':request.user})
|
record, _ = ViewRecord.objects.get_or_create(video=video, user=request.user, defaults={'video':video, 'user':request.user})
|
||||||
serializer = VRecordSerializer(instance=record)
|
serializer = VRecordSerializer(instance=record)
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
from .settings import *
|
from .settings import *
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
# 'default': {
|
|
||||||
# 'ENGINE': 'django.db.backends.postgresql',
|
|
||||||
# 'NAME': 'cma',
|
|
||||||
# 'USER': 'postgres',
|
|
||||||
# 'PASSWORD': 'zctest1234',
|
|
||||||
# 'HOST': '47.95.0.242',
|
|
||||||
# 'PORT': '5432',
|
|
||||||
# }
|
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
'NAME': 'cma',
|
'NAME': 'cma',
|
||||||
'USER': 'cma',
|
'USER': 'postgres',
|
||||||
'PASSWORD': 'cma123',
|
'PASSWORD': 'zctest1234',
|
||||||
'HOST': '172.16.80.102',
|
'HOST': '47.95.0.242',
|
||||||
'PORT': '5432',
|
'PORT': '5432',
|
||||||
}
|
}
|
||||||
|
# 'default': {
|
||||||
|
# 'ENGINE': 'django.db.backends.postgresql',
|
||||||
|
# 'NAME': 'cma',
|
||||||
|
# 'USER': 'cma',
|
||||||
|
# 'PASSWORD': 'cma123',
|
||||||
|
# 'HOST': '172.16.80.102',
|
||||||
|
# 'PORT': '5432',
|
||||||
|
# }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue