Skip to content

Commit

Permalink
修复构建仓库页面未正确应用权限设置的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
vapao committed Mar 31, 2023
1 parent 8f89e5a commit cdedc64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spug_api/apps/repository/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class RepositoryView(View):
def get(self, request):
apps = request.user.deploy_perms['apps']
deploy_id = request.GET.get('deploy_id')
data = Repository.objects.annotate(
data = Repository.objects.filter(app_id__in=apps).annotate(
app_name=F('app__name'),
env_name=F('env__name'),
created_by_user=F('created_by__nickname')).filter(deploy_id__in=apps)
created_by_user=F('created_by__nickname'))
if deploy_id:
data = data.filter(deploy_id=deploy_id, status='5')
return json_response([x.to_view() for x in data])
Expand Down
7 changes: 5 additions & 2 deletions spug_web/src/pages/deploy/repository/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ export default observer(function () {
</SearchForm.Item>
</SearchForm>
<ComTable/>
<AppSelector
visible={store.addVisible}
{store.addVisible && (
<AppSelector
visible
filter={item => item.extend === '1'}
onCancel={() => store.addVisible = false}
onSelect={store.confirmAdd}/>
)}

<Detail visible={store.detailVisible}/>
{store.formVisible && <ComForm/>}
{store.logVisible && <Console/>}
Expand Down

0 comments on commit cdedc64

Please sign in to comment.