mirror of
				https://github.com/HackSoftware/Django-Styleguide.git
				synced 2025-11-04 01:17:29 +03:00 
			
		
		
		
	Fixed spacing and tabulation (PEP8)
This commit is contained in:
		
							parent
							
								
									29c15708af
								
							
						
					
					
						commit
						cbd7f61941
					
				| 
						 | 
					@ -212,7 +212,6 @@ class CourseTests(TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        with self.assertRaises(ValidationError):
 | 
					        with self.assertRaises(ValidationError):
 | 
				
			||||||
            course.full_clean()
 | 
					            course.full_clean()
 | 
				
			||||||
 | 
					 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
There's a lot going on in this test:
 | 
					There's a lot going on in this test:
 | 
				
			||||||
| 
						 | 
					@ -427,6 +426,7 @@ Here is a good example of service that preforms some validation and raises `djan
 | 
				
			||||||
```python
 | 
					```python
 | 
				
			||||||
from django.core.exceptions import ValidationError
 | 
					from django.core.exceptions import ValidationError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def create_topic(*, name: str, course: Course) -> Topic:
 | 
					def create_topic(*, name: str, course: Course) -> Topic:
 | 
				
			||||||
    if course.end_date < timezone.now():
 | 
					    if course.end_date < timezone.now():
 | 
				
			||||||
       raise ValidationError('You can not create topics for course that has ended.')
 | 
					       raise ValidationError('You can not create topics for course that has ended.')
 | 
				
			||||||
| 
						 | 
					@ -540,9 +540,9 @@ Having this mixin in mind, our API can be written like that:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```python
 | 
					```python
 | 
				
			||||||
class CourseCreateApi(
 | 
					class CourseCreateApi(
 | 
				
			||||||
  SomeAuthenticationMixin,
 | 
					    SomeAuthenticationMixin,
 | 
				
			||||||
  ExceptionHandlerMixin,
 | 
					    ExceptionHandlerMixin,
 | 
				
			||||||
  APIView
 | 
					    APIView
 | 
				
			||||||
):
 | 
					):
 | 
				
			||||||
    class InputSerializer(serializers.Serializer):
 | 
					    class InputSerializer(serializers.Serializer):
 | 
				
			||||||
        ...
 | 
					        ...
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user