repo-forks: stable, security, fix issue when forging fork_repo_id could allow reading other people forks.
This commit is contained in:
parent
3df3815e09
commit
ce2de33a5a
1 changed files with 4 additions and 1 deletions
|
|
@ -163,10 +163,13 @@ class ForksController(BaseRepoController):
|
||||||
_form = RepoForkForm(old_data={'repo_type': c.repo_info.repo_type},
|
_form = RepoForkForm(old_data={'repo_type': c.repo_info.repo_type},
|
||||||
repo_groups=c.repo_groups_choices,
|
repo_groups=c.repo_groups_choices,
|
||||||
landing_revs=c.landing_revs_choices)()
|
landing_revs=c.landing_revs_choices)()
|
||||||
|
post_data = dict(request.POST)
|
||||||
|
post_data['fork_parent_id'] = c.repo_info.repo_id
|
||||||
|
|
||||||
form_result = {}
|
form_result = {}
|
||||||
task_id = None
|
task_id = None
|
||||||
try:
|
try:
|
||||||
form_result = _form.to_python(dict(request.POST))
|
form_result = _form.to_python(post_data)
|
||||||
# create fork is done sometimes async on celery, db transaction
|
# create fork is done sometimes async on celery, db transaction
|
||||||
# management is handled there.
|
# management is handled there.
|
||||||
task = RepoModel().create_fork(
|
task = RepoModel().create_fork(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue