Skip to content

Certification dev#16

Open
sumandari wants to merge 42 commits intodevelopfrom
certification-dev
Open

Certification dev#16
sumandari wants to merge 42 commits intodevelopfrom
certification-dev

Conversation

@sumandari
Copy link
Owner

submit PR for creating image

sumandari and others added 30 commits May 17, 2021 10:57
Fix dockerfile and documentation for dev env
…ning_member_500

Fix raising ValidationError in validate_email_address
…p_in_zip_sampledata

extract zipfile inside zipfile in sample data lesson
…mechanism

Add Mechanism to Delete Course Converner
Copy link

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth considering. View full project report here.

project_slug = self.kwargs.get('project_slug', None)
project = get_object_or_404(Project, slug=project_slug)
form.instance.project = project
return super(CertificateChecklistCreateView, self).form_valid(form)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return super(CertificateChecklistCreateView, self).form_valid(form)
return super().form_valid(form)

It's unnecessary to use arguments when calling super for the parent class. More info.

# Navbar data
self.project_slug = self.kwargs.get('project_slug', None)
context = super(
CertificateManagementTemplateView, self).get_context_data(**kwargs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CertificateManagementTemplateView, self).get_context_data(**kwargs)
).get_context_data(**kwargs)

It's unnecessary to use arguments when calling super for the parent class. More details.

# Navbar data
self.project_slug = self.kwargs.get('project_slug', None)
context = super(
ProjectCertificateTypeView, self).get_context_data(*kwargs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ProjectCertificateTypeView, self).get_context_data(*kwargs)
).get_context_data(*kwargs)

It's unnecessary to use arguments when calling super for the parent class. More details.

try:
return super(
CertifyingOrganisationUpdateView, self).form_valid(form)
super(CertifyingOrganisationUpdateView, self).form_valid(form)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
super(CertifyingOrganisationUpdateView, self).form_valid(form)
super().form_valid(form)

It's unnecessary to use arguments when calling super for the parent class. Explained here.

"""

context = super(
CertifyingOrganisationReviewView, self).get_context_data()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CertifyingOrganisationReviewView, self).get_context_data()
).get_context_data()

Again, These super arguments are unnecessary.

Project,
on_delete=models.CASCADE
)
certificate_type = models.ForeignKey(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, with an explicit related_name would be better.

Comment on lines +90 to +91
certificate_type = models.ForeignKey(
CertificateType, on_delete=models.PROTECT, null=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
certificate_type = models.ForeignKey(
CertificateType, on_delete=models.PROTECT, null=True)
certificate_type = models.ForeignKey(
CertificateType, on_delete=models.PROTECT, null=True, blank=True
)

Django automatically creates a related_name if it's not set. If it were set then a more readable and explicit relationship is set up. More details.

Expect unwanted behavior if null and blank are different values: null controls if the database allows no value for certificate_type and blank controls if the application allows no value for certificate_type. Consider setting null and blank to the same value for certificate_type. More info.

class Meta:
model = CertificateType

name = factory.sequence(lambda n: 'Test certificate type name %s' % n)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = factory.sequence(lambda n: 'Test certificate type name %s' % n)
name = factory.sequence(lambda n: f'Test certificate type name {n}')

f-string is easier to read, write, and less computationally expensive than legacy string formatting. More.


name = factory.sequence(lambda n: 'Test certificate type name %s' % n)
description = factory.sequence(
lambda n: 'Description certificate type %s' % n)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lambda n: 'Description certificate type %s' % n)
lambda n: f'Description certificate type {n}')

Same as above: Consider using f-string instead.

description = factory.sequence(
lambda n: 'Description certificate type %s' % n)
wording = factory.sequence(
lambda n: 'Wording certificate type %s' % n)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lambda n: 'Wording certificate type %s' % n)
lambda n: f'Wording certificate type {n}')

As above, Consider using f-string instead.

@codecov-commenter
Copy link

Codecov Report

Merging #16 (f0fcd05) into develop (5281142) will increase coverage by 0.73%.
The diff coverage is 67.94%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #16      +/-   ##
===========================================
+ Coverage    63.41%   64.14%   +0.73%     
===========================================
  Files          179      185       +6     
  Lines         9388     9983     +595     
  Branches       711     1282     +571     
===========================================
+ Hits          5953     6404     +451     
- Misses        3205     3328     +123     
- Partials       230      251      +21     
Impacted Files Coverage Δ
django_project/certification/urls.py 100.00% <ø> (ø)
django_project/core/settings/contrib.py 100.00% <ø> (ø)
django_project/core/settings/project.py 100.00% <ø> (ø)
django_project/lesson/models/specification.py 90.32% <ø> (ø)
django_project/lesson/urls.py 86.66% <ø> (ø)
django_project/certification/forms.py 55.30% <4.34%> (-3.73%) ⬇️
...ect/certification/views/certifying_organisation.py 41.56% <14.73%> (-7.97%) ⬇️
...oject/certification/views/certificate_checklist.py 39.58% <39.58%> (ø)
django_project/certification/models/status.py 90.00% <50.00%> (-4.45%) ⬇️
django_project/certification/views/course_type.py 57.73% <50.00%> (+17.52%) ⬆️
... and 32 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44a9d23...f0fcd05. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants