add START_SYNC flag

This commit is contained in:
Your Name 2021-09-12 23:22:25 -04:00
parent 5f43dc02bf
commit 4b1a347200
8 changed files with 11 additions and 7 deletions

View file

@ -267,3 +267,5 @@ if DEBUG:
# https://django-debug-toolbar.readthedocs.io/en/latest/
# maybe benchmarking before deployment
START_SYNC = True

View file

@ -19,7 +19,7 @@
<meta property="og:url" content="{{ request.build_absolute_uri }}">
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ game.cover.url }}">
<meta property="og:site_name" content="{{ site_name }}">
<meta property="og:description"content="{{ game.brief }}">
<meta property="og:description" content="{{ game.brief }}">
<title>{{ site_name }} - {% trans '游戏详情' %} | {{ game.title }}</title>

View file

@ -19,7 +19,7 @@
<meta property="og:url" content="{{ request.build_absolute_uri }}">
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ movie.cover.url }}">
<meta property="og:site_name" content="{{ site_name }}">
<meta property="og:description"content="{{ movie.brief }}">
<meta property="og:description" content="{{ movie.brief }}">
<!--
video:actor - profile array - Actors in the movie.
video:actor:role - string - The role they played.

View file

@ -18,7 +18,7 @@
<meta property="og:url" content="{{ request.build_absolute_uri }}">
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ album.cover.url }}">
<meta property="og:site_name" content="{{ site_name }}">
<meta property="og:description"content="{{ album.brief }}">
<meta property="og:description" content="{{ album.brief }}">
<title>{{ site_name }} - {% trans '音乐详情' %} | {{ album.title }}</title>

View file

@ -18,7 +18,7 @@
<meta property="og:url" content="{{ request.build_absolute_uri }}">
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ song.cover.url }}">
<meta property="og:site_name" content="{{ site_name }}">
<meta property="og:description"content="{{ song.brief }}">
<meta property="og:description" content="{{ song.brief }}">
<title>{{ site_name }} - {% trans '音乐详情' %} | {{ song.title }}</title>

View file

@ -1,4 +1,5 @@
from django.apps import AppConfig
from django.conf import settings
class SyncConfig(AppConfig):
@ -6,4 +7,5 @@ class SyncConfig(AppConfig):
def ready(self):
from sync.jobs import sync_task_manager
sync_task_manager.start()
if settings.START_SYNC:
sync_task_manager.start()

View file

@ -37,7 +37,7 @@
<a href="{% url 'common:home' %}" class="button">{% trans '前往我的主页' %}</a>
{% elif allow_any_site %}
<form action="/users/connect" onsubmit="Cookies.set('mastodon_domain', $('#domain').val());">
<input type="url" name="domain" id="domain" placeholder="mastodon.social" />
<input type="search" name="domain" id="domain" placeholder="输入实例地址,例如mastodon.social" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
<input type='submit' value="{% trans '授权登录' %}" />
</form>
{% else %}

View file

@ -122,7 +122,7 @@ def connect(request):
}
)
else:
login_url = "https://" + domain + "/oauth/authorize?client_id=" + app.client_id + "&scope=read+write&redirect_uri=http://" + request.get_host() + reverse('users:OAuth2_login') + "&response_type=code"
login_url = "https://" + domain + "/oauth/authorize?client_id=" + app.client_id + "&scope=read+write&redirect_uri=" + request.scheme + "://" + request.get_host() + reverse('users:OAuth2_login') + "&response_type=code"
return redirect(login_url)
@mastodon_request_included