merged master

This commit is contained in:
Egor Matveev 2021-11-13 17:17:30 +03:00
commit 68029b8acd
6 changed files with 20 additions and 12 deletions

View File

@ -5,8 +5,6 @@ stages:
variables:
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
DB_HOST: "postgres"
RABBIT_HOST: "rabbitmq"
build:
stage: build
@ -36,9 +34,7 @@ deploy-dev:
variables:
PORT: 80
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
DB_HOST: "postgres"
RABBIT_HOST: "rabbitmq"
FS_HOST: "http://storage"
HOST: "77.246.159.65"
deploy-prod:
extends:

View File

@ -21,7 +21,7 @@ class UserInfo(models.Model):
notification_solution_result = models.BooleanField(default=False)
def _append_task(self, task, tasks):
if task.creator == self.user or task.public:
if task.creator == self.user or task.public or self.user.is_superuser:
tasks.append(task)
return
for st in SetTask.objects.filter(task=task):

View File

@ -16,6 +16,9 @@ import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
HOST = os.getenv("HOST", "0.0.0.0")
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
@ -83,7 +86,7 @@ DATABASES = {
"NAME": "sprint",
"USER": "postgres",
"PASSWORD": os.getenv("DB_PASSWORD", "password"),
"HOST": os.getenv("DB_HOST", "0.0.0.0"),
"HOST": HOST,
"PORT": 5432,
}
}
@ -140,7 +143,7 @@ for root in DATA_ROOT, EXTRA_FILES_ROOT, MEDIA_ROOT:
SOLUTIONS_ROOT = os.path.join(DATA_ROOT, "solutions")
RABBIT_HOST = os.getenv("RABBIT_HOST", "0.0.0.0")
RABBIT_HOST = HOST
RABBIT_PORT = 5672
FS_HOST = os.getenv("FS_HOST", "http://0.0.0.0")

View File

@ -22,9 +22,13 @@ services:
restart: always
environment:
PORT: $PORT
<<<<<<< HEAD
DB_HOST: $DB_HOST
RABBIT_HOST: $RABBIT_HOST
FS_HOST: $FS_HOST
=======
HOST: $HOST
>>>>>>> a512261c4d4b443cf25874181acd50485f1b40a4
command: scripts/runserver.sh
ports:
- "${PORT}:${PORT}"
@ -47,6 +51,8 @@ services:
bot:
image: mathwave/sprint-repo:sprint
restart: always
environment:
HOST: $HOST
command: python manage.py bot
depends_on:
- web
@ -67,9 +73,7 @@ services:
command: scripts/create_worker.sh
environment:
SOLUTIONS_ROOT_EXTERNAL: "${SOLUTIONS_ROOT_EXTERNAL}"
DB_HOST: "${DB_HOST}"
RABBIT_HOST: "${RABBIT_HOST}"
FS_HOST: "${FS_HOST}"
HOST: $HOST
depends_on:
- web
- rabbitmq

View File

@ -24,6 +24,9 @@
<h3>
{{ account.userinfo.surname }} {{ account.userinfo.name }} {{ account.userinfo.middle_name }}
<span style="margin-left: 15px;" class="badge badge-{% if account.userinfo.activity_status == online_status %}success{% else %}secondary{% endif %}">{{ account.userinfo.activity_status }}</span>
{% if user.is_superuser %}
<a style="margin-left: 15px;" href="/admin/" class="badge badge-secondary"> Админ</a>
{% endif %}
</h3>
<table>
<tr>

View File

@ -1,5 +1,7 @@
{% extends 'base_main.html' %}
{% block title %}сеты{% endblock %}
{% block main %}
<table>
<tr>
@ -44,4 +46,4 @@
{% for set in user.userinfo.available_sets %}
<a href="/set?set_id={{ set.id }}">{{ set.name }}</a> {% if set.creator == user %}<a href="/admin/set?set_id={{ set.id }}"><i class="fa fa-pencil"></i> </a>{% endif %}<br>
{% endfor %}
{% endblock %}
{% endblock %}