← Back to team overview

sts-sponsors team mailing list archive

Re: [Merge] ~emdw/maas:timeout-configuration into maas:master

 


Diff comments:

> diff --git a/src/maasserver/sessiontimeout.py b/src/maasserver/sessiontimeout.py
> new file mode 100644
> index 0000000..6564b4d
> --- /dev/null
> +++ b/src/maasserver/sessiontimeout.py
> @@ -0,0 +1,15 @@
> +""" Custom sessionstore for a user-configurable session timeout. """
> +
> +from django.contrib.sessions.backends.db import SessionStore as DBStore
> +
> +from maasserver.models import Config
> +
> +
> +def _get_timeout() -> int:
> +    timeout = Config.objects.get_config("session_length")
> +    return timeout
> +
> +
> +class SessionStore(DBStore):
> +    def get_session_cookie_age(self) -> int:

this needs a (simple) test or two - something like "by default 2 weeks, if i change the config setting session_length then i get the value i set"

> +        return _get_timeout()


-- 
https://code.launchpad.net/~emdw/maas/+git/maas/+merge/435525
Your team MAAS Committers is subscribed to branch maas:master.



References