Skip to content

Commit e68cc2d

Browse files
ankitjain28mayRishabhJain2018
authored andcommitted
Fixed flake8 errors (#224)
* Fixed flake8 errors and fixed build #219 * Fixed flake8 errors
1 parent 2ed4a33 commit e68cc2d

5 files changed

Lines changed: 8 additions & 16 deletions

File tree

notices/admin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class NoticeAdmin(ImportExportModelAdmin):
7-
list_display = ('id','faculty', 'title', 'course_branch_year', 'created', 'modified', 'visible_for_student',
7+
list_display = ('id', 'faculty', 'title', 'course_branch_year', 'created', 'modified', 'visible_for_student',
88
'visible_for_faculty', 'visible_for_hod', 'visible_for_others', 'visible_for_management'
99
)
1010
list_display_links = ('title', 'faculty')
@@ -15,9 +15,7 @@ class NoticeAdmin(ImportExportModelAdmin):
1515
fieldsets = (
1616
(None, {
1717
'classes': ('wide', 'extrapretty'),
18-
'fields': ('faculty', 'category', 'title', 'description', 'file_attached', 'course_branch_year',
19-
'visible_for_student', 'visible_for_faculty', 'visible_for_hod',
20-
'visible_for_others', 'visible_for_management', ),
18+
'fields': ('faculty', 'category', 'title', 'description', 'file_attached', 'course_branch_year', 'visible_for_student', 'visible_for_faculty', 'visible_for_hod', 'visible_for_others', 'visible_for_management', ),
2119
}),
2220
)
2321

wifi/admin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44

55
class WifiAdmin(admin.ModelAdmin):
6-
list_display = ('__unicode__', 'email', 'name', 'old_laptop_mac_address',
7-
'new_laptop_mac_address', 'branch', 'mac_registered','created', 'modified')
6+
list_display = ('__unicode__', 'email', 'name', 'old_laptop_mac_address', 'new_laptop_mac_address', 'branch', 'mac_registered', 'created', 'modified')
87
search_fields = ('old_laptop_mac_address', 'new_laptop_mac_address', 'user__username',)
98

109

wifi/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class WifiForm(forms.ModelForm):
66

77
class Meta:
88
model = WifiDetail
9-
fields = ['old_laptop_mac_address', 'new_laptop_mac_address',]
9+
fields = ['old_laptop_mac_address', 'new_laptop_mac_address', ]
1010
exclude = ['user', ]

wifi/models.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ class WifiDetail(models.Model):
1313
blank=False,
1414
null=False,
1515
default=None,
16-
validators=[RegexValidator(regex='^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$',
17-
message='Enter MAC Address in Given Format.'), ])
16+
validators=[RegexValidator(regex='^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$', message='Enter MAC Address in Given Format.'), ])
1817
new_laptop_mac_address = models.CharField(max_length=200,
1918
blank=True,
2019
null=True,
2120
default=None,
22-
validators=[RegexValidator(regex='^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$',
23-
message='Enter MAC Address in Given Format.'), ])
21+
validators=[RegexValidator(regex='^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$', message='Enter MAC Address in Given Format.'), ])
2422
mac_registered = models.BooleanField(default=False)
2523

26-
2724
created = models.DateTimeField("Created", null=True, auto_now_add=True)
2825
modified = models.DateTimeField("Last Modified", null=True, auto_now=True)
2926

wifi/views.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from django.shortcuts import render
21
from .models import WifiDetail
32
from profiles.models import StudentDetail, FacultyDetail
43
from django.contrib.auth.models import User
@@ -10,7 +9,7 @@
109
from django.utils.decorators import method_decorator
1110
from django.contrib import messages
1211
from django.http import HttpResponse
13-
from django.shortcuts import render, get_object_or_404, redirect
12+
from django.shortcuts import render
1413
from .forms import WifiForm
1514

1615
import xlsxwriter
@@ -26,8 +25,7 @@ def get(self, request):
2625
try:
2726
mac_address = WifiDetail.objects.get(user=user)
2827
if mac_address:
29-
return render(request, 'wifi/studentwifiform.html',
30-
{"user": user, "details": details, "mac_address": mac_address})
28+
return render(request, 'wifi/studentwifiform.html', {"user": user, "details": details, "mac_address": mac_address})
3129
except:
3230
return render(request, 'wifi/studentwifiform.html', {"user": user, "details": details})
3331

0 commit comments

Comments
 (0)