I hereby claim:
- I am gabivoicu on github.
- I am gabi_voicu (https://keybase.io/gabi_voicu) on keybase.
- I have a public key ASD7j_bnaB8ezxDihqaaTAfpyGe8NfpnxdKX4Ue9IS49uwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def the_right_host(request): | |
HOST = "www.nexttier.com" | |
the_host = request.get_host() | |
if the_host.startswith("api-staging."): | |
return "stg.nexttier.com" | |
if the_host.startswith("local"): | |
return "localhost:3000" | |
return HOST |
class SendNotificationMixin(SendEmailMixin): | |
def send_notification(self, request, users, tmpl_name='', | |
permission=None, achievement=None, fmt_args={}, | |
create_center=True, force_notification=False, | |
message_type='', **kwargs):... | |
def send_completed_phase_achievement_notifications(self, request, stakeholder):... | |
def send_completed_achievement_notifications(self, request, completed_achievement):... |
def post(self, request, *args, **kwargs): | |
with transaction.atomic(): | |
serializer = CompletedAchievementCreateSerializer(data=request.data) | |
if serializer.is_valid(): | |
achievement = Achievement.objects.get(id=serializer.data['achievement']) | |
stakeholder = Stakeholder.objects.get(id=serializer.data['stakeholder']) | |
if stakeholder.stakeholder_type in ['Parent', 'Counselor']: | |
return Response(status=status.HTTP_403_FORBIDDEN) |
class ListCreateCompletedAchievements(FeedMixin, SendNotificationMixin, generics.ListCreateAPIView): | |
model = CompletedAchievement | |
permission_classes = (AchievementPermission,) | |
ordering = 'achievement__title' | |
def get_queryset(self):... | |
def get_serializer_class(self):... |
from __future__ import unicode_literals | |
import logging | |
from stakeholder.models import StakeholderPreferences | |
from message.utils import SendEmailMixin | |
from .models import Notification, NotificationTemplate | |
from stakeholder.models import EMAIL, CENTER, PUSH | |
from stakeholder.constants import LETTER_OF_REC_REQUEST |
HTML & CSS on Codecademy (you will need to get an account, but it is free)
If you have time, go through the entire course. If you have less time, complete at least the following parts: