Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
h-yaqub committed Feb 27, 2023
1 parent c75c60b commit a9f559f
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 29 deletions.
1 change: 0 additions & 1 deletion app/consumers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from channels.exceptions import StopConsumer
from channels.generic.websocket import AsyncJsonWebsocketConsumer


Expand Down
13 changes: 13 additions & 0 deletions app/migrations/0063_merge_20230227_1037.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by Django 4.1.7 on 2023-02-27 10:37

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("app", "0062_employee_currency_alter_currency_symbol"),
("app", "0062_merge_0057_notification_0061_alter_module_slug"),
]

operations = []
23 changes: 0 additions & 23 deletions app/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
create_predesigned_url_delete,
create_presigned_url,
push_notification,

send_email_forget_password,

send_leave_email,
)
from app.views import mixins
Expand Down Expand Up @@ -1040,24 +1038,3 @@ def delete(self, request, *args, **kwargs):
response = create_predesigned_url_delete(kwargs.get("key"))
requests.delete(response)
return Response(status=status.HTTP_204_NO_CONTENT)


class NotificationViewSet(ModelViewSet):
serializer_class = serializers.NotificationSerializer

def get_queryset(self):
user = self.request.user
queryset = models.Notification.objects.filter(user=user)
return queryset

def get_notification_count(self, request, *args, **kwargs):
user = self.request.user
count = models.Notification.objects.filter(employee=user, is_seen=False).count()
return Response({"count": count})

def retrieve(self, request, pk=None):
notification = self.get_object()
notification.is_seen = True
notification.save()
serializer = self.get_serializer(notification)
return Response(serializer.data)
2 changes: 1 addition & 1 deletion docker-compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- ./env.db
volumes:
- db_data:/var/lib/postgresql/data

redis:
image: redis:7.0-alpine
expose:
Expand Down
44 changes: 40 additions & 4 deletions frontend/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,37 @@
}
}
},
"/api/aws/": {
"get": {
"operationId": "api_aws_retrieve",
"/api/aws_delete_file/{key}/": {
"delete": {
"operationId": "api_aws_delete_file_destroy",
"parameters": [
{
"in": "path",
"name": "key",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"api"
],
"security": [
{
"cookieAuth": []
}
],
"responses": {
"204": {
"description": "No response body"
}
}
}
},
"/api/aws_upload_file/": {
"post": {
"operationId": "api_aws_upload_file_create",
"tags": [
"api"
],
Expand Down Expand Up @@ -4960,7 +4988,7 @@
},
"symbol": {
"type": "string",
"maxLength": 1
"maxLength": 3
},
"created_at": {
"type": "string",
Expand Down Expand Up @@ -5200,6 +5228,10 @@
"type": "integer",
"nullable": true
},
"currency": {
"type": "integer",
"nullable": true
},
"benefits": {
"type": "array",
"items": {
Expand Down Expand Up @@ -5368,6 +5400,10 @@
"type": "integer",
"nullable": true
},
"currency": {
"type": "integer",
"nullable": true
},
"benefits": {
"type": "array",
"items": {
Expand Down
2 changes: 2 additions & 0 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
AWS_SECRET_ACCESS_KEY=(str, None),
AWS_DEFAULT_REGION=(str, None),
AWS_ACCESS_KEY_ID=(str, None),
REDIS_HOST=(str, "redis"),
REDIS_PORT=(int, 6379),
)
environ.Env.read_env(pathlib.Path(BASE_DIR).joinpath(".env"))

Expand Down

0 comments on commit a9f559f

Please sign in to comment.