pythonofftopic | Unsorted

Telegram-канал pythonofftopic - Offtopic

14069

Offtopic group for casual talking about anything. @rules_for_python still apply (except for the ontopic rule)

Subscribe to a channel

Offtopic

It’ll treat you depending on market condition to put it precisely

Читать полностью…

Offtopic

it s more like "do you do good? well, private gonna treat you like a prince"

Читать полностью…

Offtopic

That’s called union. People make it in private companies too. It’s very incompetent approach and breeds inefficiency

Читать полностью…

Offtopic

Socialism you mean. Public structure work in that?

Читать полностью…

Offtopic

but it s a trade off. even if we are 3 devops, if something happened cause of me, it s not "devops team bad" but my bad only

Читать полностью…

Offtopic

i.e. I just had to prove my skills to get a promotion to a different role and the switch was direct

Читать полностью…

Offtopic

But how does private vs public effect roles?
You’d have scale which requires dedicated resources

Читать полностью…

Offtopic

if something happens, it s the single who pays

Читать полностью…

Offtopic

Do you mean accountability is lax in that structure?

Читать полностью…

Offtopic

Don't forget to replace the code with a link to the code as suggested by Doragon.

Читать полностью…

Offtopic

What's the problem? That all applications receive notifications? How would you decide which application to send the notification to if there's only supposed to be one?

Читать полностью…

Offtopic

notifications.py:

push_service = FCMNotification(service_account_file=settings.FCM_SERVICE_ACCOUNT_FILE)


@sync_to_async
def send_notifications(registration_ids: list[str], title: str, body: str) -> None:
params_list = [{"fcm_token": fcm_token, "notification_title": title, "notification_body": body}
for fcm_token in registration_ids]
result = push_service.async_notify_multiple_devices(params_list=params_list)

return result


@sync_to_async
def get_tokens(user: User) -> list[str]:
tokens = [notification.token for notification in user.notifications.all()]
return tokens


async def send_notification_to_user(user: User, title: str, body: str) -> None:
tokens = await get_tokens(user)
results = await send_notifications(tokens, title, body)

invalid_tokens = []
for i, response in enumerate(results):
if "error" in response and "registration token" in response["error"]["message"]:
invalid_tokens.append(tokens[i])

await UserNotification.objects.filter(token__in=invalid_tokens).adelete()

Читать полностью…

Offtopic

Keep listening to the music of this chat 😄

Читать полностью…

Offtopic

No it was a modified one as well

Читать полностью…

Offtopic

🤔something familiar. Yeah, this is nice, I think I've heard the version with non-glitching bass.

Читать полностью…

Offtopic

"do you feel sick and you cant manage to work as the other days? ush you are not getting paid if you dont come"

Читать полностью…

Offtopic

but as I said it s a trade off. you are covered a lot more inside the public rather than the private

Читать полностью…

Offtopic

in the public is everyone bad or everyone did good. even if 3/4 of people did nothing

Читать полностью…

Offtopic

Both structures are different. Hiring, promotion, project allocation works differently obviously.

Читать полностью…

Offtopic

got paid more from day zero

Читать полностью…

Offtopic

in the public you cant go somewhere and ask to change your role or to do something different from what you are doing. I mean, you can but it s not immediate or it is quite hard to get paid more

Читать полностью…

Offtopic

DOGE by default you meant

Читать полностью…

Offtopic

everyone knows everyone

Читать полностью…

Offtopic

Although, I'm not sure why the code would be necessary at all.

Читать полностью…

Offtopic

I don't think you can make that choice. But you can let the user decide in which application he wants to receive notifications and in which not, storing the information in the browser. Three different browsers make three different places where the configuration is stored.

Читать полностью…

Offtopic

Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://dpaste.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.

Читать полностью…

Offtopic

I have a question. If a user uses a website from 3 browsers at once and also a PWA, the service will save 4 of his tokens, and notifications for him will be duplicated. How can this problem be solved? What standard for controlling push notifications exists? I don't see a solution to the problem in sending only to one token.

Читать полностью…

Offtopic

The glitches be like

Читать полностью…

Offtopic

Non-glitching, is it the normal one?

Читать полностью…

Offtopic

@Visceros ^

Читать полностью…
Subscribe to a channel