summaryrefslogtreecommitdiffstats
path: root/core/views/expo.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-02-13 15:10:12 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-02-13 15:10:12 +0000
commit3fb99eb4be5f1c3199bdc2bab3c81f3195bf8710 (patch)
treef226a4dcf5a595fa846bcffab8e54c65b6881e9e /core/views/expo.py
parent3a3e5765f921d30a10ca3eff3db616fb4b0d58fe (diff)
downloadtroggle-3fb99eb4be5f1c3199bdc2bab3c81f3195bf8710.tar.gz
troggle-3fb99eb4be5f1c3199bdc2bab3c81f3195bf8710.tar.bz2
troggle-3fb99eb4be5f1c3199bdc2bab3c81f3195bf8710.zip
lgoing/cookie interaction betetr
Diffstat (limited to 'core/views/expo.py')
-rw-r--r--core/views/expo.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/core/views/expo.py b/core/views/expo.py
index d492820..79ad46a 100644
--- a/core/views/expo.py
+++ b/core/views/expo.py
@@ -17,9 +17,10 @@ from troggle.core.utils import (
COOKIE_MAX_AGE,
WriteAndCommitError,
current_expo,
- get_cookie,
- git_string,
- get_git_string,
+ get_editor,
+ # get_cookie,
+ # git_string,
+ # get_git_string,
write_and_commit,
is_identified_user
)
@@ -462,11 +463,8 @@ def editexpopage(request, path):
print("### File not found ### ", filepath)
filefound = False
- current_user = request.user
- if identified_login := is_identified_user(current_user):
- editor = get_git_string(current_user)
- else:
- editor = get_cookie(request)
+ identified_login = is_identified_user(request.user)
+ editor = get_editor(request)
if request.method == "POST": # If the form has been submitted...
pageform = ExpoPageForm(request.POST) # A form bound to the POST data
@@ -503,9 +501,9 @@ def editexpopage(request, path):
print(f"Cookie set: {editor} for {COOKIE_MAX_AGE/(24*3600)} days")
try:
change_message = pageform.cleaned_data["change_message"]
- if not identified_login:
- editor = pageform.cleaned_data["who_are_you"]
- editor = git_string(editor)
+ # if not identified_login:
+ # editor = pageform.cleaned_data["who_are_you"]
+ # editor = git_string(editor)
write_and_commit([(filepath, result, "utf-8")], f"{change_message} - online edit of {path}", editor)
except WriteAndCommitError as e:
return render(request, "errors/generic.html", {"message": e.message})
@@ -556,9 +554,10 @@ class ExpoPageForm(forms.Form):
identified_login = forms.BooleanField(required=False,widget=forms.CheckboxInput(attrs={"onclick":"return false"})) # makes it readonly
who_are_you = forms.CharField(
- widget=forms.Textarea(
- attrs={"cols": 90, "rows": 1, "placeholder": "You have edited this page, who are you ? e.g. 'Animal <mta@gasthof.expo>'",
- "style": "vertical-align: text-top;"}
- ),
- label = "Editor"
- )
+ widget=forms.TextInput(attrs={"style": "font-size: 90%", "size": "75",
+ "placeholder": "Anathema Device <anathema@potatohut.expo>",
+ "title":"Type in your real name, and your email between angle-brackets."
+ }),
+ label = "Editor",
+ )
+ \ No newline at end of file