diff --git a/apps/payment/views.py b/apps/payment/views.py
index 66a52935..3c80a136 100644
--- a/apps/payment/views.py
+++ b/apps/payment/views.py
@@ -201,13 +201,13 @@ class PaymentwallCallbackView(View):
).last()
if school_payment:
if payment.add_days:
- date_start = now()
+ date_start = now().shift(months=1).replace(hour=0, minute=0, day=1)
date_end = school_payment.date_end
else:
date_start = arrow.get(school_payment.date_end).shift(days=1).datetime
date_end = arrow.get(date_start).shift(months=1).datetime
else:
- date_start = now()
+ date_start = now().shift(months=1).replace(hour=0, minute=0, day=1)
date_end = arrow.get(date_start).shift(months=1).datetime
payment.date_start = date_start
payment.date_end = date_end
diff --git a/apps/user/templates/user/profile.html b/apps/user/templates/user/profile.html
index c2acc385..7a10411d 100644
--- a/apps/user/templates/user/profile.html
+++ b/apps/user/templates/user/profile.html
@@ -2,7 +2,9 @@
+ {% if not guest %}
Редактировать
+ {% endif %}
{% thumbnail user.photo "120x120" crop="center" as im %}

@@ -59,6 +61,8 @@
+
+{% if not guest %}
+{% endif %}
{% endblock content %}
diff --git a/apps/user/views.py b/apps/user/views.py
index 81f5f34f..b24825ab 100644
--- a/apps/user/views.py
+++ b/apps/user/views.py
@@ -43,14 +43,20 @@ def resend_email_verify(request):
return redirect('user-edit-profile', request.user.id)
-@method_decorator(login_required, name='dispatch')
+# @method_decorator(login_required, name='dispatch')
class UserView(DetailView):
model = User
template_name = 'user/profile.html'
def get_context_data(self, object):
context = super().get_context_data()
- context['simple_user'] = self.request.user.role == User.USER_ROLE
+ if not self.request.user.is_anonymous:
+ context['simple_user'] = self.request.user.role == User.USER_ROLE
+ context['guest'] = self.request.user.id != self.object.id and self.request.user.role <= User.USER_ROLE
+ else:
+ context['simple_user'] = True
+ context['guest'] = True
+
context['published'] = Course.objects.filter(
author=self.object,
)
diff --git a/project/templates/blocks/teachers.html b/project/templates/blocks/teachers.html
index 79623393..639d6b90 100644
--- a/project/templates/blocks/teachers.html
+++ b/project/templates/blocks/teachers.html
@@ -16,10 +16,11 @@

{% endif %}