Skip to content

Commit

Permalink
fix: API Failing with player placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoTN committed Apr 22, 2018
1 parent 324f408 commit 13b1ab3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
35 changes: 19 additions & 16 deletions api/emailing.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
from django.core.mail import send_mail


def send_invitation(email, activation_code):
send_mail(
subject='[Invitation] Rethink the way you play table football!',
message='''
Hi!
You have been invited to TFoosball. Join us here: https://tfoosball.herokuapp.com/accept/{0}/
The service is not active yet, thank you for your patience.
'''.format(activation_code),
# html_message='Here is the message.',
from_email='[email protected]',
recipient_list=[email],
fail_silently=False,
)
from django.core.mail import send_mail


def send_invitation(email, activation_code):
send_mail(
subject='[Invitation] Rethink the way you play table football!',
message='''
Hi!
You have been invited to TFoosball. Join us here: https://tfoosball.herokuapp.com/accept/{0}/
Best regards,
TFoosball Team
'''.format(activation_code),
# html_message='Here is the message.',
from_email='[email protected]',
recipient_list=[email],
fail_silently=False,
)
6 changes: 3 additions & 3 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class MemberSerializer(serializers.ModelSerializer):
att_ratio = serializers.SerializerMethodField()
def_ratio = serializers.SerializerMethodField()
win_ratio = serializers.SerializerMethodField()
email = serializers.CharField(source='player.email', read_only=True)
# TODO Consider nested serializer
first_name = serializers.CharField(source='player.first_name')
last_name = serializers.CharField(source='player.last_name')
email = serializers.CharField(source='player.email', read_only=True)
first_name = serializers.CharField(source='player.first_name', default='')
last_name = serializers.CharField(source='player.last_name', default='')
whats_new_version = serializers.IntegerField(source='player.whats_new_version', read_only=True)
default_team = serializers.IntegerField(source='player.default_team.pk', default=-1)
user_id = serializers.IntegerField(source='player.pk', read_only=True)
Expand Down
2 changes: 1 addition & 1 deletion templates/callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'FRONTEND_CLIENT': '{{ FRONTEND_CLIENT }}',
}
</script>
<script src="{% static "callback.js" %}?v=2.4.0"></script>
<script src="{% static "callback.js" %}?v=2.4.1"></script>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="stylesheet" href="{% static "styles.css" %}">
</head>
<body>
<h1>TFoosball API v2.4.0</h1>
<h1>TFoosball API v2.4.1</h1>
<p>Carefully crafted by <a href="http://www.piotrstaniow.pl/">Piotr Staniów</a></p>
</body>
</html>

0 comments on commit 13b1ab3

Please sign in to comment.