| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 10ff10a commit 12e9788
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,8 @@ class UserProfileInline(admin.StackedInline): | |||
| 47 | 47 | ||
| 48 | 48 | class UserAdmin(BaseUserAdmin): | |
| 49 | 49 | inlines = (UserProfileInline, ) | |
| 50 | + | ||
| 51 | + | ||
| 50 | 52 | admin.site.unregister(User) | |
| 51 | 53 | admin.site.register(User, UserAdmin) | |
| 52 | 54 | ||
@@ -61,6 +63,8 @@ class ProjectAdmin(admin.ModelAdmin): | |||
| 61 | 63 | inlines = [ | |
| 62 | 64 | DelegationRuleInline, | |
| 63 | 65 | ] | |
| 66 | + | ||
| 67 | + | ||
| 64 | 68 | admin.site.register(Project, ProjectAdmin) | |
| 65 | 69 | ||
| 66 | 70 | ||
@@ -74,11 +78,15 @@ def has_account(self, person): | |||
| 74 | 78 | has_account.boolean = True | |
| 75 | 79 | has_account.admin_order_field = 'user' | |
| 76 | 80 | has_account.short_description = 'Account' | |
| 81 | + | ||
| 82 | + | ||
| 77 | 83 | admin.site.register(Person, PersonAdmin) | |
| 78 | 84 | ||
| 79 | 85 | ||
| 80 | 86 | class StateAdmin(admin.ModelAdmin): | |
| 81 | 87 | list_display = ('name', 'action_required') | |
| 88 | + | ||
| 89 | + | ||
| 82 | 90 | admin.site.register(State, StateAdmin) | |
| 83 | 91 | ||
| 84 | 92 | ||
@@ -87,6 +95,8 @@ class SubmissionAdmin(admin.ModelAdmin): | |||
| 87 | 95 | list_filter = ('project', ) | |
| 88 | 96 | search_fields = ('name', 'submitter__name', 'submitter__email') | |
| 89 | 97 | date_hierarchy = 'date' | |
| 98 | + | ||
| 99 | + | ||
| 90 | 100 | admin.site.register(Submission, SubmissionAdmin) | |
| 91 | 101 | admin.site.register(CoverLetter, SubmissionAdmin) | |
| 92 | 102 | ||
@@ -104,13 +114,17 @@ def is_pull_request(self, patch): | |||
| 104 | 114 | is_pull_request.boolean = True | |
| 105 | 115 | is_pull_request.admin_order_field = 'pull_url' | |
| 106 | 116 | is_pull_request.short_description = 'Pull' | |
| 117 | + | ||
| 118 | + | ||
| 107 | 119 | admin.site.register(Patch, PatchAdmin) | |
| 108 | 120 | ||
| 109 | 121 | ||
| 110 | 122 | class CommentAdmin(admin.ModelAdmin): | |
| 111 | 123 | list_display = ('submission', 'submitter', 'date') | |
| 112 | 124 | search_fields = ('submission__name', 'submitter__name', 'submitter__email') | |
| 113 | 125 | date_hierarchy = 'date' | |
| 126 | + | ||
| 127 | + | ||
| 114 | 128 | admin.site.register(Comment, CommentAdmin) | |
| 115 | 129 | ||
| 116 | 130 | ||
@@ -130,6 +144,8 @@ class SeriesAdmin(admin.ModelAdmin): | |||
| 130 | 144 | def received_all(self, series): | |
| 131 | 145 | return series.received_all | |
| 132 | 146 | received_all.boolean = True | |
| 147 | + | ||
| 148 | + | ||
| 133 | 149 | admin.site.register(Series, SeriesAdmin) | |
| 134 | 150 | ||
| 135 | 151 | ||
@@ -148,6 +164,8 @@ def received_all(self, series): | |||
| 148 | 164 | ||
| 149 | 165 | class SeriesReferenceAdmin(admin.ModelAdmin): | |
| 150 | 166 | model = SeriesReference | |
| 167 | + | ||
| 168 | + | ||
| 151 | 169 | admin.site.register(SeriesReference, SeriesReferenceAdmin) | |
| 152 | 170 | ||
| 153 | 171 | ||
@@ -157,16 +175,22 @@ class CheckAdmin(admin.ModelAdmin): | |||
| 157 | 175 | exclude = ('date', ) | |
| 158 | 176 | search_fields = ('patch__name', 'project__name') | |
| 159 | 177 | date_hierarchy = 'date' | |
| 178 | + | ||
| 179 | + | ||
| 160 | 180 | admin.site.register(Check, CheckAdmin) | |
| 161 | 181 | ||
| 162 | 182 | ||
| 163 | 183 | class BundleAdmin(admin.ModelAdmin): | |
| 164 | 184 | list_display = ('name', 'owner', 'project', 'public') | |
| 165 | 185 | list_filter = ('public', 'project') | |
| 166 | 186 | search_fields = ('name', 'owner') | |
| 187 | + | ||
| 188 | + | ||
| 167 | 189 | admin.site.register(Bundle, BundleAdmin) | |
| 168 | 190 | ||
| 169 | 191 | ||
| 170 | 192 | class TagAdmin(admin.ModelAdmin): | |
| 171 | 193 | list_display = ('name',) | |
| 194 | + | ||
| 195 | + | ||
| 172 | 196 | admin.site.register(Tag, TagAdmin) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -377,6 +377,7 @@ def patch_id_from_hash(rpc, project, hash): | |||
| 377 | 377 | sys.exit(1) | |
| 378 | 378 | return patch_id | |
| 379 | 379 | ||
| 380 | + | ||
| 380 | 381 | auth_actions = ['check_create', 'update'] | |
| 381 | 382 | ||
| 382 | 383 | ||
@@ -606,7 +607,8 @@ def main(): | |||
| 606 | 607 | config.read([CONFIG_FILE]) | |
| 607 | 608 | ||
| 608 | 609 | if not config.has_section('options') and os.path.exists(CONFIG_FILE): | |
| 609 | - sys.stderr.write('%s is in the old format. Migrating it...' % CONFIG_FILE) | ||
| 610 | + sys.stderr.write('%s is in the old format. Migrating it...' % | ||
| 611 | + CONFIG_FILE) | ||
| 610 | 612 | ||
| 611 | 613 | old_project = config.get('base', 'project') | |
| 612 | 614 | ||
@@ -793,5 +795,6 @@ def main(): | |||
| 793 | 795 | action_parser.print_help() | |
| 794 | 796 | sys.exit(1) | |
| 795 | 797 | ||
| 798 | + | ||
| 796 | 799 | if __name__ == "__main__": | |
| 797 | 800 | main() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -172,6 +172,7 @@ def _user_saved_callback(sender, created, instance, **kwargs): | |||
| 172 | 172 | profile = UserProfile(user=instance) | |
| 173 | 173 | profile.save() | |
| 174 | 174 | ||
| 175 | + | ||
| 175 | 176 | models.signals.post_save.connect(_user_saved_callback, sender=User) | |
| 176 | 177 | ||
| 177 | 178 | ||
@@ -907,4 +908,5 @@ def _patch_change_callback(sender, instance, **kwargs): | |||
| 907 | 908 | notification.last_modified = datetime.datetime.now() | |
| 908 | 909 | notification.save() | |
| 909 | 910 | ||
| 911 | + | ||
| 910 | 912 | models.signals.pre_save.connect(_patch_change_callback, sender=Patch) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,7 @@ def _compile(value): | |||
| 33 | 33 | regex, cls = value | |
| 34 | 34 | return re.compile(regex, re.M | re.I), cls | |
| 35 | 35 | ||
| 36 | + | ||
| 36 | 37 | _patch_span_res = [_compile(x) for x in [ | |
| 37 | 38 | (r'^(Index:?|diff|\-\-\-|\+\+\+|\*\*\*) .*$', 'p_header'), | |
| 38 | 39 | (r'^\+.*$', 'p_add'), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,6 +133,7 @@ def _marshaled_dispatch(self, request): | |||
| 133 | 133 | ||
| 134 | 134 | return response | |
| 135 | 135 | ||
| 136 | + | ||
| 136 | 137 | dispatcher = PatchworkXMLRPCDispatcher() | |
| 137 | 138 | ||
| 138 | 139 | # XMLRPC view function | |
| Back | FazBrowse Home | New Git URL |
0 commit comments