Skip to content

Commit a65a083

Browse files
authored
Merge pull request #74 from joanmdrs/feat/issue72
Feat/issue72
2 parents 1de4ede + b75320e commit a65a083

File tree

53 files changed

+3233
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3233
-447
lines changed

.env.sample

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE=True
1111
SECURE_CONTENT_TYPE_NOSNIFF=True
1212
SECURE_BROWSER_XSS_FILTER=True
1313

14+
# VARIÁVEIS NECESSÁRIAS PARA ENVIO DE E-MAIL
15+
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
16+
EMAIL_HOST=smtp.gmail.com
17+
EMAIL_PORT=587
18+
EMAIL_USE_TLS=True
19+
EMAIL_HOST_USER=[email protected]
20+
EMAIL_HOST_PASSWORD=xhtcjihxckiraizs
21+
DEFAULT_FROM_EMAIL=[email protected]
22+
RESET_LINK_BASE=https://labens.dct.ufrn.br/academicflow
23+
1424
# CORS
1525
CORS_ALLOW_ALL_ORIGINS=True
1626
CORS_ALLOWED_ORIGINS="http://labens.dct.ufrn.br, http://localhost:8005, http://127.0.0.1:8005"

academic_dev_flow/settings.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
'django.contrib.staticfiles',
4848
'rest_framework',
4949
'corsheaders',
50+
'django_rest_passwordreset',
5051
'apps.projeto',
5152
'apps.fluxo',
5253
'apps.etapa',
@@ -66,7 +67,8 @@
6667
'apps.api',
6768
'apps.github_integration',
6869
'drf_yasg',
69-
'apps.feedback'
70+
'apps.feedback',
71+
'apps.chat'
7072
]
7173

7274
SWAGGER_SETTINGS = {
@@ -115,7 +117,7 @@
115117
TEMPLATES = [
116118
{
117119
'BACKEND': 'django.template.backends.django.DjangoTemplates',
118-
'DIRS': [],
120+
'DIRS': [BASE_DIR / 'templates'],
119121
'APP_DIRS': True,
120122
'OPTIONS': {
121123
'context_processors': [
@@ -146,6 +148,14 @@
146148
}
147149
}
148150

151+
EMAIL_BACKEND = config('EMAIL_BACKEND')
152+
EMAIL_HOST = config('EMAIL_HOST')
153+
EMAIL_PORT = config('EMAIL_PORT', cast=int)
154+
EMAIL_USE_TLS = config('EMAIL_USE_TLS', cast=bool)
155+
EMAIL_HOST_USER = config('EMAIL_HOST_USER')
156+
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
157+
DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL')
158+
RESET_LINK_BASE = config('RESET_LINK_BASE')
149159

150160
# Password validation
151161
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators

academic_dev_flow/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
path('academicflow-api/auth/', include('apps.api.urls', namespace='api')),
5858
path('academicflow-api/github_integration/', include('apps.github_integration.urls', namespace='github_integration')),
5959
path('academicflow-api/', RedirectView.as_view(url='/academicflow-api/admin/')),
60+
path('academicflow-api/api/password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),
61+
path('academicflow-api/chat/', include('apps.chat.urls', namespace='chat')),
6062
]
6163

6264
if settings.DEBUG:

apps/chat/__init__.py

Whitespace-only changes.

apps/chat/admin.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from django.contrib import admin
2+
from .models import Chat, Mensagem
3+
4+
class ChatAdmin(admin.ModelAdmin):
5+
list_display = ('id','nome', 'projeto', 'data_criacao')
6+
list_filter = ('projeto', 'data_criacao')
7+
search_fields = ('nome',)
8+
9+
class MensagemAdmin(admin.ModelAdmin):
10+
list_display = ('chat', 'conteudo', 'autor', 'enviado_em', 'editado_em')
11+
list_filter = ('chat', 'autor', 'enviado_em')
12+
search_fields = ('autor',)
13+
14+
admin.site.register(Chat, ChatAdmin)
15+
admin.site.register(Mensagem, MensagemAdmin)
16+

apps/chat/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class ChatConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'apps.chat'
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Generated by Django 5.0.3 on 2025-04-22 19:16
2+
3+
import django.db.models.deletion
4+
from django.conf import settings
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
('projeto', '0004_projeto_coordenador'),
14+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name='Chat',
20+
fields=[
21+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22+
('nome', models.CharField(max_length=255)),
23+
('data_criacao', models.DateTimeField(auto_now_add=True)),
24+
('projeto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projeto.projeto')),
25+
],
26+
),
27+
migrations.CreateModel(
28+
name='Mensagem',
29+
fields=[
30+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
31+
('conteudo', models.TextField(max_length=500)),
32+
('enviado_em', models.DateTimeField(auto_now_add=True)),
33+
('editado_em', models.DateTimeField(auto_now=True)),
34+
('autor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mensagens_criadas', to=settings.AUTH_USER_MODEL)),
35+
('chat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='mensagens', to='chat.chat')),
36+
],
37+
),
38+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 5.0.3 on 2025-04-28 21:54
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('chat', '0001_initial'),
11+
('projeto', '0004_projeto_coordenador'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='chat',
17+
name='projeto',
18+
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projeto.projeto', unique=True),
19+
),
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 5.0.3 on 2025-04-28 21:55
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('chat', '0002_alter_chat_projeto'),
11+
('projeto', '0004_projeto_coordenador'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='chat',
17+
name='projeto',
18+
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='projeto.projeto'),
19+
),
20+
]

apps/chat/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)