Remove git version

This commit is contained in:
Gabriel Augendre 2019-03-02 16:55:38 +01:00
parent d28ee02447
commit 16bebe5f99
3 changed files with 0 additions and 26 deletions

View file

@ -79,7 +79,6 @@ TEMPLATES = [
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'map.context_processors.app_settings',
'map.context_processors.git_version',
],
},
},

View file

@ -1,28 +1,6 @@
from git import Repo
from django.conf import settings
def get_git_version():
"""
Get the git version of the site.
"""
try:
repo = Repo(settings.BASE_DIR)
commit = repo.head.commit.hexsha
name = commit[:7]
return {'name': name, 'url': u'{}/commit/{}'.format(settings.APP['site']['repository']['url'], commit)}
except (KeyError, TypeError):
return {'name': '', 'url': ''}
def git_version(request):
"""
A context processor to include the git version on all pages.
"""
return {'git_version': get_git_version()}
def app_settings(request):
"""
A context processor with all APP settings.

View file

@ -8,9 +8,6 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="{{ git_version.url }}">Version : {{ git_version.name }}</a>
</li>
<li class="nav-item dropdown">
{% if user.is_authenticated %}
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"