diff options
Diffstat (limited to 'core/utils.py')
-rw-r--r-- | core/utils.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/utils.py b/core/utils.py index 673dcee..8647d44 100644 --- a/core/utils.py +++ b/core/utils.py @@ -5,6 +5,7 @@ import os import random import re import resource +import socket import string import subprocess from datetime import datetime, timezone @@ -45,6 +46,8 @@ sha = hashlib.new('sha256') COOKIE_MAX_AGE = 12*60*60 # seconds throw = 35.0 +EXPOSERVER = "expo" # hostname of the server at expo.survex.com + DEV_OK = """On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) @@ -260,7 +263,12 @@ def git_commit(cwd, message, editor, commands=[]): """ git = settings.GIT print(f"git commit in {cwd}") - print(f"Committing:\n{message=}\n{editor=}") + + if socket.gethostname() != EXPOSERVER: + message += f" on dev machine '{socket.gethostname()}'" + elif settings.DEVSERVER: + message += " on a dev machine using 'runserver'" + print(f"..{message=}\n..{editor=}") cmd_commit = [git, "commit", "-m", message, "--author", f"{editor}"] commands.append(cmd_commit) |