Skip to content

Commit

Permalink
Non-breaking update
Browse files Browse the repository at this point in the history
  • Loading branch information
adilmohak committed Oct 6, 2024
1 parent 3c4af49 commit b53760e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions result/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_JUSTIFY, TA_LEFT, TA_CENTER, TA_RIGHT
from reportlab.platypus.tables import Table

# from reportlab.platypus.tables import Table
from reportlab.lib.units import inch
from reportlab.lib import colors

from accounts.models import Student
from core.models import Session, Semester
from course.models import Course
from accounts.models import Student
from accounts.decorators import lecturer_required, student_required
from .models import TakenCourse, Result


cm = 2.54
CM = 2.54


# ########################################################
Expand Down Expand Up @@ -130,8 +131,7 @@ def add_score_for(request, id):
for i in courses:
if i == courses.count():
break
else:
total_credit_in_semester += int(i.credit)
total_credit_in_semester += int(i.credit)
score = data.getlist(
ids[s]
) # get list of score for current student in the loop
Expand Down Expand Up @@ -304,8 +304,8 @@ def result_sheet_pdf_view(request, id):
doc = SimpleDocTemplate(
flocation,
rightMargin=0,
leftMargin=6.5 * cm,
topMargin=0.3 * cm,
leftMargin=6.5 * CM,
topMargin=0.3 * CM,
bottomMargin=0,
)
styles = getSampleStyleSheet()
Expand Down Expand Up @@ -683,7 +683,7 @@ def course_registration_form(request):
"",
)
]
color = colors.black
# color = colors.black
count += 1
table_body = Table(data, 1 * [1.4 * inch], 1 * [0.3 * inch])
table_body.setStyle(
Expand Down Expand Up @@ -738,14 +738,14 @@ def course_registration_form(request):

logo = settings.STATICFILES_DIRS[0] + "/img/brand.png"
im_logo = Image(logo, 1 * inch, 1 * inch)
im_logo.__setattr__("_offs_x", -218)
im_logo.__setattr__("_offs_y", 480)
setattr(im_logo, "_offs_x", -218)
setattr(im_logo, "_offs_y", 480)
Story.append(im_logo)

picture = settings.BASE_DIR + request.user.get_picture()
im = Image(picture, 1.0 * inch, 1.0 * inch)
im.__setattr__("_offs_x", 218)
im.__setattr__("_offs_y", 550)
setattr(im, "_offs_x", 218)
setattr(im, "_offs_y", 550)
Story.append(im)

doc.build(Story)
Expand Down

0 comments on commit b53760e

Please sign in to comment.