Ticket #7929: 7929.admin.cleanup.diff

File 7929.admin.cleanup.diff, 3.4 KB (added by Julien Phalip, 16 years ago)
  • django/django/contrib/admin/options.py

     
    462462        "The 'add' admin view for this model."
    463463        model = self.model
    464464        opts = model._meta
    465         app_label = opts.app_label
    466465
    467466        if not self.has_add_permission(request):
    468467            raise PermissionDenied
    469468
    470         if self.has_change_permission(request, None):
    471             # redirect to list view
    472             post_url = '../'
    473         else:
    474             # Object list will give 'Permission Denied', so go back to admin home
    475             post_url = '../../../'
    476 
    477469        ModelForm = self.get_form(request)
    478470        inline_formsets = []
    479471        obj = self.model()
     
    519511        "The 'change' admin view for this model."
    520512        model = self.model
    521513        opts = model._meta
    522         app_label = opts.app_label
    523514
    524515        try:
    525516            obj = model._default_manager.get(pk=object_id)
  • django/django/contrib/admin/widgets.py

     
    106106        else:
    107107            url = ''
    108108        if not attrs.has_key('class'):
    109           attrs['class'] = 'vForeignKeyRawIdAdminField' # The JavaScript looks for this hook.
     109            attrs['class'] = 'vForeignKeyRawIdAdminField' # The JavaScript looks for this hook.
    110110        output = [super(ForeignKeyRawIdWidget, self).render(name, value, attrs)]
    111111        # TODO: "id_" is hard-coded here. This should instead use the correct
    112112        # API to determine the ID dynamically.
  • django/django/contrib/admin/sites.py

     
    11from django import http, template
    22from django.contrib.admin import ModelAdmin
    33from django.contrib.auth import authenticate, login
    4 from django.core.exceptions import ImproperlyConfigured
    54from django.db.models.base import ModelBase
    65from django.shortcuts import render_to_response
    76from django.utils.safestring import mark_safe
     
    1110from django.conf import settings
    1211import base64
    1312import cPickle as pickle
    14 import datetime
    1513import md5
    1614import re
    1715
     
    2725    pass
    2826
    2927def _encode_post_data(post_data):
    30     from django.conf import settings
    3128    pickled = pickle.dumps(post_data)
    3229    pickled_md5 = md5.new(pickled + settings.SECRET_KEY).hexdigest()
    3330    return base64.encodestring(pickled + pickled_md5)
    3431
    3532def _decode_post_data(encoded_data):
    36     from django.conf import settings
    3733    encoded_data = base64.decodestring(encoded_data)
    3834    pickled, tamper_check = encoded_data[:-32], encoded_data[-32:]
    3935    if md5.new(pickled + settings.SECRET_KEY).hexdigest() != tamper_check:
     
    204200        This takes into account the USE_I18N setting. If it's set to False, the
    205201        generated JavaScript will be leaner and faster.
    206202        """
    207         from django.conf import settings
    208203        if settings.USE_I18N:
    209204            from django.views.i18n import javascript_catalog
    210205        else:
Back to Top