~petersanchez

Los Angeles, CA

https://www.petersanchez.com

LA, CA USA - Managua, Nicaragua

~petersanchez/public-inbox

Last active 8 days ago

~petersanchez/blog-discussion

Last active 3 years ago
View more

Recent activity

Re: [PATCH django-impersonate] Add support for Django 5.0 (pre) 3 months ago

From Peter Sanchez to ~petersanchez/public-inbox

Hugo,

Sorry for the delay. Because it affects an unreleased version this patch
hasn't had high priority.

Can you adapt this to be just 1 `compat.py` file versus multiple. Help
keep the footprint as lean as possible.

Thanks,

Peter

Re: [PATCH django-impersonate] Handle upcoming removal of timezone.utc (Django 5) 5 months ago

From Peter Sanchez to ~petersanchez/public-inbox

Thank you for this patch but it doesn't apply cleanly. Seems like most
changes fail to apply. Did you make sure you have the latest version
pulled into your clone?

Thanks,

Peter

On 03/08, Hugo Rodger-Brown wrote:
># HG changeset patch
># User Hugo Rodger-Brown <hugo@yunojuno.com>
># Date 1678268809 0
># Wed Mar 08 09:46:49 2023 +0000
># Node ID c0c223b5e10524c9cad20de0b11d901277f5b89d

Discussion Mailing List 5 months ago

From Peter Sanchez to ~netlandish/blog-discussion

We decided to remove Disqus from our public blog and move to a simple
mailing list method. There are many reasons we wanted to get rid of
Disqus but the main reason is we want to own ALL of our data.

Past discussions should be archived on the Disqus site but to be honest,
I haven't looked into where/how to view them. If there is a request for
it then I'll dig them up.

In the future we will only use this mailing list for blog discussions.

Hope to have some interesting conversations here.

- Peter & All of the team here at Netlandish

django-impersonate 1.9.1 released 7 months ago

From Peter Sanchez to ~petersanchez/public-inbox

Hey all. Just an FYI that django-impersonate 1.9.1 was just released
with much appreciated contributions from:

- Sarah Boyce
- Oscar Cortez
- Arne Brodowski

Covers the following issues:

https://todo.code.netlandish.com/~petersanchez/django-impersonate/67

https://todo.code.netlandish.com/~petersanchez/django-impersonate/69

https://todo.code.netlandish.com/~petersanchez/django-impersonate/70

Re: [PATCH django-impersonate] Record the impersonator on the user object 2 years ago

From Peter Sanchez to ~petersanchez/public-inbox

On 02/04, Jordi Gutiérrez Hermoso wrote:
># HG changeset patch
># User Jordi Gutiérrez Hermoso <jordigh@gnu.org>
># Date 1612473215 18000
>#      Thu Feb 04 16:13:35 2021 -0500
># Node ID 02c4ab3442b2f9c2df491b0663fae5caa8129418
># Parent  ccefd024a3fbf62b698bf38d750b7d03d1d74a65

Thanks! Applied here:

https://hg.code.netlandish.com/~petersanchez/django-impersonate/rev/c400cc81c4f6ff9bb0e94fb8485919ae283e08b0

I'll push a minor update to pypi shortly.

Re: [PATCH django-impersonate] optimization | preserve request.user laziness 2 years ago

From Peter Sanchez to ~petersanchez/public-inbox

On 12/22, Илья wrote:
>class ImpersonateMiddleware(MiddlewareMixin):
>    def process_request(self, request):
>        _usr = request.user  # save as local var to prevent infinite recursion
>        def _get_usr():
>            _usr.is_impersonate = False
>            return _usr
>
>        request.user = SimpleLazyObject(_get_usr)
>        request.impersonator = None
>
>        if '_impersonate' in request.session and request.user.is_authenticated:
>            ....

Re: [PATCH django-impersonate] optimization | preserve request.user laziness 2 years ago

From Peter Sanchez to ~petersanchez/public-inbox

Interesting catch. I have some thoughts below.

On 12/21, Илья wrote:
>class ImpersonateMiddleware(MiddlewareMixin):
>    def process_request(self, request):
>        request.user.is_impersonate = False  # <----- this one
>        request.impersonator = None
>
>        if is_authenticated(request.user) and \  # <----- and this one
>           '_impersonate' in request.session:
>            new_user_id = request.session['_impersonate']
>            .....
>
>As a quick-and-dirty fix we can just remove the first line - but in