Commit d347663e authored by Arkadiusz Hiler's avatar Arkadiusz Hiler
Browse files

Fix whitespace errors for PEP-8 compliance



So the code passes the checks.
Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 831ebd7c
......@@ -37,6 +37,8 @@ class ProjectAdmin(admin.ModelAdmin):
inlines = [
DelegationRuleInline,
]
admin.site.register(Project, ProjectAdmin)
......@@ -50,16 +52,22 @@ class PersonAdmin(admin.ModelAdmin):
has_account.boolean = True
has_account.admin_order_field = 'user'
has_account.short_description = 'Account'
admin.site.register(Person, PersonAdmin)
class UserProfileAdmin(admin.ModelAdmin):
search_fields = ('user__username', 'user__first_name', 'user__last_name')
admin.site.register(UserProfile, UserProfileAdmin)
class StateAdmin(admin.ModelAdmin):
list_display = ('name', 'action_required')
admin.site.register(State, StateAdmin)
......@@ -78,6 +86,7 @@ class SeriesAdmin(admin.ModelAdmin):
'reviewer__first_name', 'reviewer__last_name')
date_hierarchy = 'submitted'
admin.site.register(Series, SeriesAdmin)
......@@ -102,6 +111,7 @@ class SeriesRevisionAdmin(admin.ModelAdmin):
submitter_name.short_description = 'Submitter'
submitter_name.admin_order_field = 'series__submitter__name'
admin.site.register(SeriesRevision, SeriesRevisionAdmin)
......@@ -118,6 +128,8 @@ class PatchAdmin(admin.ModelAdmin):
is_pull_request.boolean = True
is_pull_request.admin_order_field = 'pull_url'
is_pull_request.short_description = 'Pull'
admin.site.register(Patch, PatchAdmin)
......@@ -125,6 +137,8 @@ class CommentAdmin(admin.ModelAdmin):
list_display = ('patch', 'submitter', 'date')
search_fields = ('patch__name', 'submitter__name', 'submitter__email')
date_hierarchy = 'date'
admin.site.register(Comment, CommentAdmin)
......@@ -137,12 +151,16 @@ class EventAdmin(admin.ModelAdmin):
def event_name(self, log):
return log.event.name
admin.site.register(EventLog, EventAdmin)
class TestAdmin(admin.ModelAdmin):
list_display = ('name', 'project')
list_filter = ('project', )
admin.site.register(Test, TestAdmin)
......@@ -152,6 +170,8 @@ class TestResultAdmin(admin.ModelAdmin):
search_fields = ('test__name', 'patch__name', 'revision__series__name',
'test__project__name')
date_hierarchy = 'date'
admin.site.register(TestResult, TestResultAdmin)
......@@ -159,9 +179,13 @@ class BundleAdmin(admin.ModelAdmin):
list_display = ('name', 'owner', 'project', 'public')
list_filter = ('public', 'project')
search_fields = ('name', 'owner')
admin.site.register(Bundle, BundleAdmin)
class TagAdmin(admin.ModelAdmin):
list_display = ('name',)
admin.site.register(Tag, TagAdmin)
......@@ -172,7 +172,7 @@ def find_author(mail):
try:
person = Person.objects.get(email__iexact=email)
if person.name != name:
if person.name != name:
person.name = name
save_required = True
except Person.DoesNotExist:
......
......@@ -359,6 +359,7 @@ def patch_id_from_hash(rpc, project, hash):
sys.exit(1)
return patch_id
auth_actions = ['update']
......@@ -736,5 +737,6 @@ def main():
action_parser.print_help()
sys.exit(1)
if __name__ == "__main__":
main()
......@@ -407,6 +407,7 @@ class DelegateFilter(Filter):
self.applied = False
self.forced = True
filterclasses = [SubmitterFilter,
StateFilter,
SearchFilter,
......
......@@ -256,5 +256,6 @@ class MultiplePatchForm(forms.Form):
class EmailForm(forms.Form):
email = forms.EmailField(max_length=200)
UserPersonLinkForm = EmailForm
OptinoutRequestForm = EmailForm
......@@ -122,6 +122,7 @@ def user_name(user):
return u' '.join(names)
return user.username
auth.models.User.add_to_class('name', user_name)
......@@ -204,6 +205,7 @@ def _user_saved_callback(sender, created, instance, **kwargs):
profile = UserProfile(user=instance)
profile.save()
models.signals.post_save.connect(_user_saved_callback, sender=User)
......@@ -478,6 +480,7 @@ class BundlePatch(models.Model):
unique_together = [('bundle', 'patch')]
ordering = ['order']
SERIES_DEFAULT_NAME = "Series without cover letter"
......@@ -557,6 +560,7 @@ class Series(models.Model):
class Meta:
verbose_name_plural = 'Series'
# Signal one can listen to to know when a revision is complete (ie. has all of
# its patches)
series_revision_complete = django.dispatch.Signal(providing_args=["revision"])
......@@ -992,4 +996,5 @@ def _on_revision_complete(sender, revision, **kwargs):
parameters={'revision': revision.version})
log.save()
series_revision_complete.connect(_on_revision_complete)
......@@ -307,6 +307,7 @@ def main(args):
filenames = patch_get_filenames(content)
print("File names: ----\n" + '\n'.join(filenames))
if __name__ == '__main__':
import sys
sys.exit(main(sys.argv))
......@@ -34,6 +34,7 @@ def _compile(t):
(r, str) = t
return (re.compile(r, re.M | re.I), str)
_patch_span_res = list(map(_compile, [
('^(Index:?|diff|\-\-\-|\+\+\+|\*\*\*) .*$', 'p_header'),
('^\+.*$', 'p_add'),
......
......@@ -295,5 +295,6 @@ class testlock(unittest.TestCase):
lock.release()
if __name__ == '__main__':
unittest.main(__name__)
......@@ -64,6 +64,7 @@ I hope you'll like it."""
review = """This is a great addition!"""
error_strings = {
'email': 'Enter a valid email address.',
}
......
......@@ -120,6 +120,7 @@ class Order(object):
return qs.order_by(*orders)
bundle_actions = ['create', 'add', 'remove']
......
......@@ -153,6 +153,7 @@ def user_complete(request):
return HttpResponse(json.dumps(data), content_type="application/json")
help_pages = {'': 'index.html',
'about/': 'about.html',
}
......
......@@ -133,6 +133,7 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher,
return response
dispatcher = PatchworkXMLRPCDispatcher()
# XMLRPC view function
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment