# Watchers
- def is_watching(self, account):
+ def is_watched_by(self, account):
res = self.db.get("SELECT 1 FROM wiki_watchlist \
WHERE page = %s AND uid = %s", self.page, account.uid)
return False
def add_watcher(self, account):
- if self.is_watching(account):
+ if self.is_watched_by(account):
return
self.db.execute("INSERT INTO wiki_watchlist(page, uid) \
</div>
</div>
- {% if page and not page.is_watching(current_user) %}
+ {% if page and not page.is_watched_by(current_user) %}
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="watch" id="watch" checked>
<label class="form-check-label" for="watch">{{ _("Watch this page") }}</label>
<p class="small">
{% if current_user %}
- {% if page.is_watching(current_user) %}
+ {% if page.is_watched_by(current_user) %}
<a href="/action/unwatch{{ page.url }}"><span class="fas fa-star" title="{{ _("Stop watching this page") }}"></span></a>
{% else %}
<a href="/action/watch{{ page.url }}"><span class="far fa-star" title="{{ _("Watch this page") }}"></span></a>