Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix localization error #50

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ cython_debug/
.vscode*

# DB dumps
dump.json
dump*

# Static folder
static/
Expand Down
2 changes: 1 addition & 1 deletion infra/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
build: ../
image: funtech_celery_worker
container_name: funtech_celery_worker
command: celery -A config.celery.app worker worker -l INFO
command: celery -A config.celery.app worker -l INFO
volumes:
- static_value:/app/static/
- media_value:/app/media/
Expand Down
2 changes: 1 addition & 1 deletion infra/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
celery_worker:
image: hackathonyacrm/funtech_backend:v.01
container_name: funtech_celery_worker
command: celery -A config.celery.app worker worker -l INFO
command: celery -A config.celery.app worker -l INFO
volumes:
- static_value:/app/static/
- media_value:/app/media/
Expand Down
16 changes: 16 additions & 0 deletions src/applications/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,19 @@ def send_email_after_submission_of_application(
"submit_application.html", {"first_name": first_name, "event": event}
)
send_mail(subject, message, from_email=None, recipient_list=[to_email])


@shared_task
def remind_participant_about_upcoming_event(
first_name: str, event: str, date: str, time: str, to_email: str, **kwargs
) -> None:
"""
Reminds the person who applied to participate in the event
that the event will start soon.
"""
subject = "Напоминание о предстоящем мероприятии"
message = render_to_string(
"remind_by_email.html",
{"first_name": first_name, "event": event, "date": date, "time": time},
)
send_mail(subject, message, from_email=None, recipient_list=[to_email])
3 changes: 2 additions & 1 deletion src/events/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class EventListSerializer(serializers.ModelSerializer):
submitted_applications = serializers.SerializerMethodField()
first_speaker = serializers.SerializerMethodField()
image = Base64ImageField()
status = serializers.CharField(source="get_status_display")
format = serializers.CharField(source="get_format_display")

class Meta:
Expand Down Expand Up @@ -237,6 +236,8 @@ class EventDetailSerializer(EventListSerializer):

event_parts = EventPartSerializer(many=True, source="parts")
image = Base64ImageField()
status = serializers.CharField(source="get_status_display")
format = serializers.CharField(source="get_format_display")

class Meta(EventListSerializer.Meta):
fields = [
Expand Down
10 changes: 10 additions & 0 deletions src/templates/remind_by_email.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% autoescape off %}
Здравствуйте, {{ first_name }}!

Напоминаем вам, что мероприятие {{ event }}, на участие в котором вы ранее подавали
заявку через https://hackathon-funtech.sytes.net/, начнется {{ date }} в {{ time }}
по московскому времени.

С уважением,
Funtech.
{% endautoescape %}
2 changes: 1 addition & 1 deletion src/templates/submit_application.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
Ответим вам в ближайшее время.

С уважением,
Ваш Funtech.
Funtech.
{% endautoescape %}