Skip to content
Snippets Groups Projects
Commit 12ff1915 authored by Máté Bodor's avatar Máté Bodor Committed by Barnabás Czémán
Browse files

Note (#40)

* emails

* update dependenis and fix flake8 error

* update dependenis and fix flake8 error
parent 54575cbf
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ diff-match-patch==20121119 # via django-import-export
django-import-export==1.0.0
django-social-authsch==0.1
django-solo==1.1.3
django==2.0.1
django>=2.0.10
djangorestframework==3.7.7
et-xmlfile==1.0.1 # via openpyxl
gunicorn==19.7.1
......@@ -23,14 +23,14 @@ openpyxl==2.5.0 # via tablib
pyjwt==1.5.3 # via social-auth-core
python3-openid==3.1.0 # via social-auth-core
pytz==2017.3 # via django
pyyaml==3.12 # via tablib
pyyaml>=4.2b1 # via tablib
requests-oauthlib==0.8.0 # via social-auth-core
requests==2.18.4 # via requests-oauthlib, social-auth-core
requests>=2.20.0 # via requests-oauthlib, social-auth-core
six==1.11.0 # via social-auth-app-django, social-auth-core
social-auth-app-django==2.1.0 # via django-social-authsch
social-auth-core==1.6.0 # via django-social-authsch, social-auth-app-django
tablib==0.12.1 # via django-import-export
unicodecsv==0.14.1 # via tablib
urllib3==1.22 # via requests
urllib3>=1.23 # via requests
xlrd==1.1.0 # via tablib
xlwt==1.3.0 # via tablib
......@@ -14,7 +14,7 @@ def read_email(name):
def registration(user):
subject = "Kszképzés regisztráció"
message = read_email('registration.txt')
message = str.format(message %{'name': user.get_full_name()})
message = str.format(message % {'name': user.get_full_name()})
send_mail(subject, message, sender_email, [user.email, ])
......@@ -47,5 +47,5 @@ def homework_corrected(user, title, accepted):
else:
status = 'Hibás'
message = read_email('homework_corrected.txt')
message = str.format(message % {'name': user.get_full_name(), 'link': link, 'status': status, 'title': title })
message = str.format(message % {'name': user.get_full_name(), 'link': link, 'status': status, 'title': title})
send_mail(subject, message, sender_email, [user.email, ])
......@@ -64,7 +64,7 @@ class SolutionSerializer(serializers.ModelSerializer):
return value
def update(self, instance, validated_data):
if instance.corrected == False and validated_data.get('corrected', instance.corrected) == True:
if instance.corrected is not True and validated_data.get('corrected', instance.corrected) is True:
email.homework_corrected(
instance.created_by.user,
instance.task.title,
......@@ -76,4 +76,3 @@ class SolutionSerializer(serializers.ModelSerializer):
profile = CurrentUserMiddleware.get_current_user_profile()
models.Solution.objects.filter(created_by=profile, task=validated_data['task']).delete()
return super().create(validated_data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment