SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
119
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
3fd48da0
Commit
3fd48da0
authored
1 year ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
add unprotecting branch step to git repo creation
parent
74254455
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost_django/production/management/commands/advance_git_repos.py
+12
-0
12 additions, 0 deletions
...jango/production/management/commands/advance_git_repos.py
with
12 additions
and
0 deletions
scipost_django/production/management/commands/advance_git_repos.py
+
12
−
0
View file @
3fd48da0
...
...
@@ -13,6 +13,7 @@ from common.utils import get_current_domain
from
gitlab
import
Gitlab
from
gitlab.v4.objects
import
Group
,
Project
from
gitlab.exceptions
import
GitlabGetError
from
gitlab.const
import
AccessLevel
import
arxiv
import
requests
...
...
@@ -148,6 +149,17 @@ class Command(BaseCommand):
}
)
# Unprotect "main" branch to allow developers to push to it
project
.
protectedbranches
.
delete
(
"
main
"
)
project
.
protectedbranches
.
create
(
{
"
name
"
:
"
main
"
,
"
merge_access_level
"
:
AccessLevel
.
MAINTAINER
,
"
push_access_level
"
:
AccessLevel
.
DEVELOPER
,
"
allow_force_push
"
:
False
,
}
)
self
.
stdout
.
write
(
self
.
style
.
SUCCESS
(
f
"
Created git repository at
{
repo
.
git_path
}
"
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment