modify a little
This commit is contained in:
parent
e9c64de9d8
commit
53f0bbb4e4
|
@ -120,7 +120,7 @@ WSGI_APPLICATION = 'Codepedia2.wsgi.application'
|
|||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': 'codepedia',
|
||||
'NAME': 'codepedia_1',
|
||||
'USER': 'root',
|
||||
'PASSWORD': 'codepedia123',
|
||||
'HOST': '127.0.0.1'
|
||||
|
|
|
@ -86,11 +86,14 @@ class ShowAnnotationView(View):
|
|||
def get_group_annotation(self,file_id,line_num,user_id):
|
||||
# 首先获取当前组的所有用户id
|
||||
# 根据到当前的id获取到group username list
|
||||
users = get_group_users(user_id,file_id)
|
||||
users = get_group_users(user_id,file_id)
|
||||
# user_ids = []
|
||||
# 然后调用
|
||||
commit_id = self.get_current_commitid_by_fileid(file_id)
|
||||
annotations = Annotation.objects.filter(file_id=file_id, linenum=line_num,user__in=users,is_latest=1,commit_id=commit_id)
|
||||
if users is None:
|
||||
annotations = Annotation.objects.filter(file_id=file_id, linenum=line_num,user_id=user_id,is_latest=1,commit_id=commit_id)
|
||||
else:
|
||||
annotations = Annotation.objects.filter(file_id=file_id, linenum=line_num,user__in=users,is_latest=1,commit_id=commit_id)
|
||||
return annotations
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue