new field added
This commit is contained in:
@@ -30,6 +30,11 @@ class UserInfo(models.Model):
|
||||
code = models.IntegerField(null=True)
|
||||
verified = models.BooleanField(default=False)
|
||||
|
||||
@property
|
||||
def tasks_solved(self):
|
||||
fltr = Task.objects.filter(solution__result=CONSTS["ok_status"], solution__user=self.user).distinct()
|
||||
return len(fltr)
|
||||
|
||||
@property
|
||||
def has_favourite_language(self):
|
||||
return self.favourite_language_id is not None
|
||||
|
@@ -1,7 +1,5 @@
|
||||
from typing import Optional
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
from Main.management.commands.bot import bot
|
||||
from Main.models import Chat, Message
|
||||
from Sprint.settings import CONSTS
|
||||
@@ -25,7 +23,6 @@ class ChatView(BaseView):
|
||||
user=self.request.user,
|
||||
chat=self.entities.chat,
|
||||
text=self.request.POST["text"],
|
||||
time_sent=timezone.now(),
|
||||
)
|
||||
if (
|
||||
self.entities.chat.user.userinfo.activity_status != CONSTS["online_status"]
|
||||
|
Reference in New Issue
Block a user