This commit is contained in:
Julien Constant
2023-03-14 12:15:35 +01:00
parent 6f6d65b663
commit 87b5ff12c5
5 changed files with 35 additions and 14 deletions

View File

@ -22,6 +22,7 @@
#
#
import subprocess
import re
# Image utils
@ -37,6 +38,11 @@ import PIL
from django.conf import settings
from django.core.files.base import ContentFile
def get_git_revision_short_hash() -> str:
"""
Return the short hash of the current commit
"""
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
def get_start_of_semester(d=date.today()):
"""