diff --git a/apps/auth/views.py b/apps/auth/views.py index 4cea8327..6c3cd79b 100644 --- a/apps/auth/views.py +++ b/apps/auth/views.py @@ -11,6 +11,7 @@ from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generic import FormView, View from django.views.generic.edit import BaseFormView +from django.shortcuts import redirect from apps.notification.utils import send_email from .forms import LearnerRegistrationForm @@ -56,9 +57,9 @@ class LearnerRegistrationView(FormView): class LogoutView(View): - def post(self, request, *args, **kwargs): + def get(self, request, *args, **kwargs): logout(request) - return JsonResponse({"success": True}) + return redirect('/') class LoginView(FormView): diff --git a/apps/course/models.py b/apps/course/models.py index 12db9652..2cbc6d27 100644 --- a/apps/course/models.py +++ b/apps/course/models.py @@ -18,10 +18,13 @@ class Like(models.Model): class Course(models.Model): + PENDING = 0 + PUBLISHED = 1 + ARCHIVED = 2 STATUS_CHOICES = ( - (0, 'Pending'), - (1, 'Published'), - (2, 'Archived'), + (PENDING, 'Pending'), + (PUBLISHED, 'Published'), + (ARCHIVED, 'Archived'), ) author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) title = models.CharField('Название курса', max_length=100, db_index=True) diff --git a/apps/user/templates/user/profile.html b/apps/user/templates/user/profile.html new file mode 100644 index 00000000..2142dca5 --- /dev/null +++ b/apps/user/templates/user/profile.html @@ -0,0 +1,92 @@ +{% extends "templates/lilcity/index.html" %} {% load static %} {% block content %} +
+