funkwhale/api/funkwhale_api/users/adapters.py

14 wiersze
554 B
Python
Czysty Zwykły widok Historia

from allauth.account.adapter import DefaultAccountAdapter
2018-06-10 08:55:16 +00:00
from django.conf import settings
from dynamic_preferences.registries import global_preferences_registry
class FunkwhaleAccountAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request):
manager = global_preferences_registry.manager()
2018-06-09 13:36:16 +00:00
return manager["users__registration_enabled"]
def send_mail(self, template_prefix, email, context):
2018-06-09 13:36:16 +00:00
context["funkwhale_url"] = settings.FUNKWHALE_URL
return super().send_mail(template_prefix, email, context)