Skip to content

Commit

Permalink
Cleaning up admin
Browse files Browse the repository at this point in the history
  • Loading branch information
etianen committed Jul 15, 2015
1 parent e3ea51f commit 5c2d1c4
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/reversion/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,6 @@ def log_change(self, request, object, message):
self.revision_context_manager.set_comment(message)
super(VersionAdmin, self).log_change(request, object, message)

# Customization hooks.

def get_revision_form_data(self, request, obj, version):
"""
Returns a dictionary of data to set in the admin form in order to revert
to the given revision.
"""
return version.field_dict

# Auto-registration.

def _autoregister(self, model, follow=None):
Expand Down Expand Up @@ -218,7 +209,7 @@ def render_revision_form(self, request, version, extra_context, revert=False, re
raise PermissionDenied
# Create the form and formsets.
ModelForm = self.get_form(request, obj)
form = ModelForm(instance=obj, initial=self.get_revision_form_data(request, obj, version))
form = ModelForm(instance=obj)
formsets, inline_instances = self._create_formsets(request, obj, change=True)
# Generate admin form helper.
fieldsets = list(self.get_fieldsets(request, obj))
Expand Down

0 comments on commit 5c2d1c4

Please sign in to comment.