This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| start on (filesystem) | |
| stop on runlevel [016] | |
| script | |
| . /var/lib/cloud/instance/user-data.txt | |
| chdir /home/ubuntu/NextTier-Achievement-Worker | |
| . /home/ubuntu/venv/bin/activate | |
| exec python /home/ubuntu/NextTier-Achievement-Worker/worker.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def __init__(self, *args, **kwargs): | |
| for k, v in kwargs: | |
| setattr(self, k, v) | |
| def __init__(self, *args, **kwargs): | |
| self.first_name = kwargs.pop('first_name', None) | |
| self.last_name = kwargs.pop('last_name', None) | |
| self.email = kwargs.pop('email', None) | |
| def __init__(self, first_name=None, last_name=None, email=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| base_task = Task.objects.create(institution=None, **bullshit_data) | |
| for institution in Institution.objects.all(): | |
| new_task = base_task | |
| new_task.pk = None | |
| new_task.institution = institution | |
| new_task.save() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def post(self, request): | |
| 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']) | |
| try: | |
| CompletedAchievement.objects.create( | |
| achievement=achievement, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CreateRetrieveUpdateDestroyApplication( | |
| generics.CreateAPIView, generics.RetrieveUpdateDestroyAPIView): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE_TABLE_STATEMENTS = { | |
| 'achievement_achievement': | |
| '''CREATE TABLE achievement_achievement | |
| ( | |
| id int, | |
| title varchar(255), | |
| description text | |
| ); | |
| ''', | |
| 'task_task': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DEBUG = os.getenv('DEBUG', False) | |
| STATIC_ROOT = 'static' | |
| STATIC_URL= '/static/' | |
| if DEBUG==False: | |
| STATIC_URL = 'http://{0}.s3.amazonaws.com/'.format(AWS_S3_BUCKET) |
NewerOlder