diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-05-23 21:58:21 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-05-23 21:58:21 +0300 |
commit | 1bb950ec456a88ca43d5e2e4acefe94748326ee7 (patch) | |
tree | 1a2bd154d43527a4488d74e3f5049d386a57a4b7 /core/views/other.py | |
parent | c7df859d80368bf8c908097571948a47f7d45673 (diff) | |
download | troggle-1bb950ec456a88ca43d5e2e4acefe94748326ee7.tar.gz troggle-1bb950ec456a88ca43d5e2e4acefe94748326ee7.tar.bz2 troggle-1bb950ec456a88ca43d5e2e4acefe94748326ee7.zip |
initial method for identifying potato hut laptops as cookie
Diffstat (limited to 'core/views/other.py')
-rw-r--r-- | core/views/other.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/views/other.py b/core/views/other.py index 18ab31f..6d1b175 100644 --- a/core/views/other.py +++ b/core/views/other.py @@ -11,7 +11,7 @@ from troggle.core.models.logbooks import LogbookEntry, writelogbook # , PersonL # from databaseReset import reinit_db # don't do this. databaseRest runs code *at import time* from troggle.core.models.troggle import Expedition -from troggle.core.utils import current_expo +from troggle.core.utils import current_expo, COOKIE_MAX_AGE from troggle.parsers.imports import ( import_caves, import_drawingsfiles, @@ -36,6 +36,12 @@ todo = """ to the website. """ +def public_laptop(request): + """Just sets a cookie. Visit this web page from Crowley, Anathema, Aziraphale, Pulsifer etc. + """ + response = HttpResponse("Cookie has been set on this machine, which now defines it as a public laptop. So login cookie lifetimes will now be short.") + response.set_cookie("public_laptop", "this is a public laptop", max_age=COOKIE_MAX_AGE) # Cookie expires in 1 hour + return response def todos(request, module): """produces todo text from module |