Conversation
Fix dockerfile and documentation for dev env
…2_fix_update_sustaining_member_500
…3_delete_converner_mechanism
…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
…1_certification_type
Add Certificate Type
…n-failure Update version parameter
…tification-dev
| 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) |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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() |
There was a problem hiding this comment.
| CertifyingOrganisationReviewView, self).get_context_data() | |
| ).get_context_data() |
Again, These super arguments are unnecessary.
| Project, | ||
| on_delete=models.CASCADE | ||
| ) | ||
| certificate_type = models.ForeignKey( |
There was a problem hiding this comment.
Again, with an explicit related_name would be better.
| certificate_type = models.ForeignKey( | ||
| CertificateType, on_delete=models.PROTECT, null=True) |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| lambda n: 'Wording certificate type %s' % n) | |
| lambda n: f'Wording certificate type {n}') |
As above, Consider using f-string instead.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
submit PR for creating image