Esempio n. 1
0
 def submit_action(self, instance):
     """
     Submits a quota request email
     """
     requested_quota = instance.request
     reason_for_request = instance.description
     username = self.request.user.username
     quota_request_email(self.request, username, requested_quota, reason_for_request)
Esempio n. 2
0
    def _email(self, request, username, new_quota, reason):
        """
        Processes Increase Quota request. Sends email to [email protected]

        Returns a response.
        """
        return quota_request_email(request, username, new_quota, reason)
Esempio n. 3
0
    def _email(self, request, username, new_quota, reason):
        """
        Processes Increase Quota request. Sends email to [email protected]

        Returns a response.
        """
        return quota_request_email(request, username, new_quota, reason)
Esempio n. 4
0
 def post(self, request):
     """
     Creates a new Quota Request email and sends it to admins
     """
     data = request.data
     required = ['quota', 'reason']
     missing_keys = valid_post_data(data, required)
     if missing_keys:
         return keys_not_found(missing_keys)
     #Pass arguments
     username = request.user.username
     quota = data['quota']
     reason = data['reason']
     result = quota_request_email(request, username, quota, reason)
     return Response(result, status=status.HTTP_201_CREATED)
 def post(self, request):
     """
     Creates a new Quota Request email and sends it to admins
     """
     data = request.data
     required = ['quota', 'reason']
     missing_keys = valid_post_data(data, required)
     if missing_keys:
         return keys_not_found(missing_keys)
     #Pass arguments
     username = request.user.username
     quota = data['quota']
     reason = data['reason']
     result = quota_request_email(request, username, quota, reason)
     return Response(result, status=status.HTTP_201_CREATED)