mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
check git verification state
This commit is contained in:
parent
4fb3fffbe6
commit
680a7071e5
@ -149,12 +149,12 @@ class NavigationMixin:
|
|||||||
|
|
||||||
def get_git_log(path):
|
def get_git_log(path):
|
||||||
path = path.replace(os.path.dirname(settings.BASE_DIR), '')[1:]
|
path = path.replace(os.path.dirname(settings.BASE_DIR), '')[1:]
|
||||||
command = ['git', 'log', '-n', '1', "--pretty=format:'%H%n%aN%n%aE%n%ad%n%f'", '--follow', '--', path]
|
command = ['git', 'log', '-n', '1', "--pretty=format:'%H%n%aN%n%aE%n%aI%n%f%n%G?%n%GK'", '--follow', '--', path]
|
||||||
try:
|
try:
|
||||||
output = str(subprocess.check_output(command, cwd=os.path.dirname(settings.BASE_DIR)), 'utf-8')[1:-1].split('\n')
|
output = str(subprocess.check_output(command, cwd=os.path.dirname(settings.BASE_DIR)), 'utf-8')[1:-1].split('\n')
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
output = 5 * ['']
|
output = 7 * ['']
|
||||||
return {'hash': output[0], 'author': output[1], 'mail': output[2], 'date': output[3], 'message': output[4]}
|
return {'hash': output[0], 'author': output[1], 'mail': output[2], 'date': output[3], 'message': output[4], 'verified': output[5], 'key': output[6]}
|
||||||
|
|
||||||
|
|
||||||
class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin):
|
class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin):
|
||||||
|
@ -37,6 +37,14 @@
|
|||||||
<td><span class='fas fa-envelope'></span></td>
|
<td><span class='fas fa-envelope'></span></td>
|
||||||
<td>{% trans "Commit Message" %}</td><td>{{ plugin.commit.message }}{% include "clip.html" %}</td>
|
<td>{% trans "Commit Message" %}</td><td>{{ plugin.commit.message }}{% include "clip.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-check'></span></td>
|
||||||
|
<td>{% trans "Commit verified" %}</td><td>{{ plugin.commit.verified }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-key'></span></td>
|
||||||
|
<td>{% trans "Commit Sign Key" %}</td><td>{{ plugin.commit.key }}{% include "clip.html" %}</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
Loading…
Reference in New Issue
Block a user