Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
90675821
Commit
90675821
authored
Apr 11, 2018
by
Maël Kervella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove multiple try/except for getting git info
parent
ce8fa577
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
29 deletions
+7
-29
re2o/views.py
re2o/views.py
+7
-29
No files found.
re2o/views.py
View file @
90675821
...
...
@@ -173,39 +173,17 @@ def about_page(request):
git_info_contributors
=
CONTRIBUTORS
try
:
git_repo
=
git
.
Repo
(
BASE_DIR
)
except
git
.
InvalidGitRepositoryError
:
NO_GIT_MSG
=
_
(
"No Git repository configured"
)
git_info_remote
=
", "
.
join
(
git_repo
.
remote
().
urls
)
git_info_branch
=
git_repo
.
active_branch
.
name
last_commit
=
git_repo
.
commit
()
git_info_commit
=
last_commit
.
hexsha
git_info_commit_date
=
last_commit
.
committed_datetime
except
:
NO_GIT_MSG
=
_
(
"Unable to get the information"
)
git_info_remote
=
NO_GIT_MSG
git_info_branch
=
NO_GIT_MSG
git_info_commit
=
NO_GIT_MSG
git_info_commit_date
=
NO_GIT_MSG
else
:
UNABLE_GIT_MSG
=
_
(
"Unable to get the information"
)
try
:
git_info_remote
=
", "
.
join
(
git_repo
.
remote
().
urls
)
except
:
git_info_remote
=
UNABLE_GIT_MSG
try
:
git_info_branch
=
git_repo
.
active_branch
.
name
except
:
git_info_branch
=
UNABLE_GIT_MSG
try
:
last_commit
=
git_repo
.
commit
()
except
:
git_info_commit
=
UNABLE_GIT_MSG
else
:
try
:
git_info_commit
=
last_commit
.
hexsha
except
:
git_info_commit
=
UNABLE_GIT_MSG
try
:
git_info_commit_date
=
last_commit
.
committed_datetime
except
:
git_info_commit_date
=
UNABLE_GIT_MSG
dependencies
=
INSTALLED_APPS
+
MIDDLEWARE_CLASSES
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment