|
@@ -69,9 +69,10 @@ def main():
|
|
|
if kind != "150" and kind != "Admin": # We only have this two log types
|
|
|
raise KindError
|
|
|
if method == "POST":
|
|
|
+ send_mail = input()
|
|
|
auth(user_id, "POST", kind) # Check if the user can post for the requested kind
|
|
|
log = sys.stdin.read() # Read the log content
|
|
|
- method_post(kind, user_name, date, tags, log)
|
|
|
+ method_post(kind, user_name, date, tags, log, send_mail == "Yes")
|
|
|
elif method == "GET":
|
|
|
auth(user_id, "GET", kind) # Check if the user can get logs for the requested kind
|
|
|
user_to_find = input() # Read the user name of the log writer to search
|
|
@@ -254,8 +255,10 @@ def method_get(kind, user_to_find, date, tags):
|
|
|
|
|
|
|
|
|
# Write log
|
|
|
-def method_post(kind, user_name, date, tags, log):
|
|
|
+def method_post(kind, user_name, date, tags, log, send_mail):
|
|
|
name = log_create(kind, user_name, date, tags, log)
|
|
|
+ if send_mail:
|
|
|
+ log_mail(kind, user_name, date, tags, log)
|
|
|
logger.info("POST successful: hash " + name)
|
|
|
|
|
|
|