WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.6k stars 1.02k forks source link

Project status bar action button doesn't change after subscribed #5787

Open Aikatsui opened 3 years ago

Aikatsui commented 3 years ago

Describe the issue

See the title and once subscribed then button need to change from "get notified when this project is unlocked again" to "unsubscribe from notification" or other.

To Reproduce the issue

https://hosted.weblate.org/projects/f-droid/website/

Chandrika-Priya commented 2 years ago

Hi @nijel can you please tell me where the problem related piece of code exists

nijel commented 2 years ago

The template is here: https://github.com/WeblateOrg/weblate/blob/main/weblate/templates/snippets/component/lock.html

Chandrika-Priya commented 2 years ago

Thank you @nijel

2004yash commented 3 weeks ago

Hey @nijel, I was going through the above template, can you tell me, from where can I get the subscription status of the user ??

nijel commented 3 weeks ago

It is stored using the Subscription model, probably some helper based on that needs to be developed:

https://github.com/WeblateOrg/weblate/blob/f19490667209266a7fd94b72d1b1dd03321f0d80/weblate/accounts/models.py#L140-L163