diff options
author | Akshen | 2019-05-14 15:34:16 +0530 |
---|---|---|
committer | Akshen | 2019-05-14 15:34:16 +0530 |
commit | f5f525368c6054c31abf6c0ff786a31b2a388661 (patch) | |
tree | 6701c70ea2139ce1d4aa9cf271119c6dcb918643 /fossee_manim | |
parent | df1bca4647a456291851c596c39dc96a438913de (diff) | |
download | FOSSEE_animations-f5f525368c6054c31abf6c0ff786a31b2a388661.tar.gz FOSSEE_animations-f5f525368c6054c31abf6c0ff786a31b2a388661.tar.bz2 FOSSEE_animations-f5f525368c6054c31abf6c0ff786a31b2a388661.zip |
2nd Proposal Form Button
Diffstat (limited to 'fossee_manim')
-rw-r--r-- | fossee_manim/send_mails.py | 24 | ||||
-rw-r--r-- | fossee_manim/templates/fossee_manim/edit_proposal.html | 3 | ||||
-rw-r--r-- | fossee_manim/views.py | 7 |
3 files changed, 32 insertions, 2 deletions
diff --git a/fossee_manim/send_mails.py b/fossee_manim/send_mails.py index 93841f2..a35f6f4 100644 --- a/fossee_manim/send_mails.py +++ b/fossee_manim/send_mails.py @@ -131,3 +131,27 @@ def send_email(request, call_on, contributor=None, key=None, proposal=None): send_mail( "FOSSEE Animation Comment by Reviewer", message, SENDER_EMAIL, [contributor.profile.user.email], fail_silently=True) + elif call_on == 'proposal_form': + message = dedent("""\ + Hey {0}, + + Please find the attachment, fill the form and reply to this + mail. + + In case of queries, please revert to this + email.""".format(contributor.profile.user.username)) + + logging.info("Animation Proposal Form 2: %s", request.user.email) + subject = "FOSSEE Animation Proposal Form 2" + msg = EmailMultiAlternatives(subject, message, SENDER_EMAIL, + [contributor.profile.user.email]) + attachment_paths = path.join(settings.MEDIA_ROOT, "Proposal_Form") + files = listdir(attachment_paths) + for f in files: + attachment = open(path.join(attachment_paths, f), 'rb') + part = MIMEBase('application', 'octet-stream') + part.set_payload((attachment).read()) + encoders.encode_base64(part) + part.add_header('Content-Disposition', "attachment; filename= %s " % f) + msg.attach(part) + msg.send() diff --git a/fossee_manim/templates/fossee_manim/edit_proposal.html b/fossee_manim/templates/fossee_manim/edit_proposal.html index 55c0f75..08fe638 100644 --- a/fossee_manim/templates/fossee_manim/edit_proposal.html +++ b/fossee_manim/templates/fossee_manim/edit_proposal.html @@ -47,7 +47,8 @@ <div class="form-group"> <div class="row"> <button class="btn btn-success pull-left" type="submit" name="release" value="1">Approve</button> - <button class="btn btn-danger pull-left" type="submit" name="rejected" value="2" style="margin-left: 3%">Reject</button> + <button class="btn btn-danger pull-left" type="submit" name="rejected" value="2" style="margin-left: 1%">Reject</button> + <button class="btn btn-info pull-left" type="submit" name="proposal_form" value="3" style="margin-left: 1%" >Send Proposal 2 Form</button> </div> </div> </form> diff --git a/fossee_manim/views.py b/fossee_manim/views.py index feb23de..fde164b 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -334,12 +334,17 @@ def edit_proposal(request, proposal_id=None): text = request.POST.get('comment') status1 = request.POST.get('release') status2 = request.POST.get('rejected') + status3 = request.POST.get('proposal_form') - if status1 or status2 is not None: + if status1 or status2 or status3 is not None: if status1: proposal.status = 'released' send_email(request, call_on='released', contributor=proposal.contributor) + elif status3: + send_email(request, call_on='proposal_form', + contributor=proposal.contributor) + return redirect('/proposal_status/') else: proposal.status = 'rejected' makepath(proposal, reject=1) |