[tasks] Fix todoist login link on settings
This commit is contained in:
@ -3,6 +3,7 @@ from django.http.response import HttpResponseBadRequest
|
||||
from django.urls import reverse_lazy
|
||||
from django.views.generic import FormView
|
||||
from profiles.forms import UserProfileForm
|
||||
from tasks.todoist import generate_todoist_oauth_url
|
||||
|
||||
|
||||
class ProfileFormView(LoginRequiredMixin, FormView):
|
||||
@ -27,4 +28,5 @@ class ProfileFormView(LoginRequiredMixin, FormView):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["user_id"] = self.request.user.id
|
||||
context["profile"] = self.request.user.profile
|
||||
context["todoist_oauth_url"] = generate_todoist_oauth_url(self.request.user.id)
|
||||
return context
|
||||
|
||||
@ -146,7 +146,7 @@
|
||||
<a href="{% url 'tasks:task_todoist_auth' %}" class="btn btn-sm btn-secondary">Reconnect to Todoist</a>
|
||||
{% else %}
|
||||
<p>Not connected</p>
|
||||
<a href="{% url 'tasks:task_todoist_auth' %}" class="btn btn-sm btn-primary">Connect to Todoist</a>
|
||||
<a href="{{todoist_oauth_url}}" class="btn btn-sm btn-primary">Connect to Todoist</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user