from django.conf.urls import patterns, url
from functools import partial

from problems.models import UserSolution

from .views import download_protected_file

urlpatterns = patterns('',
    url(r'solutions/(?P<path>.*)$', partial(download_protected_file,
                                            path_prefix='solutions/',
                                            model_class=UserSolution),
        name='download_solution'),
)

from django.conf.urls import patterns, url
from functools import partial

from problems.models import UserSolution

from .views import download_protected_file

urlpatterns = patterns('',
    url(r'solutions/(?P<path>.*)$', download_protected_file,
        dict(path_prefix='solutions/', model_class=UserSolution),
        name='download_solution'),
)

Remove unnecessary usage of functools.partial
downloads: Remove unnecessary usage of functools.partial

  from django.conf.urls import patterns, url
  from functools import partial
  
  from problems.models import UserSolution
  
  from .views import download_protected_file
  
  urlpatterns = patterns('',
-     url(r'solutions/(?P<path>.*)$', partial(download_protected_file,
+     url(r'solutions/(?P<path>.*)$', download_protected_file,
+         dict(path_prefix='solutions/', model_class=UserSolution),
-                                             path_prefix='solutions/',
-                                             model_class=UserSolution),
          name='download_solution'),
  )
  
Remove unnecessary usage of functools.partial
## Code Before:
from django.conf.urls import patterns, url
from functools import partial

from problems.models import UserSolution

from .views import download_protected_file

urlpatterns = patterns('',
    url(r'solutions/(?P<path>.*)$', partial(download_protected_file,
                                            path_prefix='solutions/',
                                            model_class=UserSolution),
        name='download_solution'),
)

## Instruction:
Remove unnecessary usage of functools.partial
## Code After:
from django.conf.urls import patterns, url
from functools import partial

from problems.models import UserSolution

from .views import download_protected_file

urlpatterns = patterns('',
    url(r'solutions/(?P<path>.*)$', download_protected_file,
        dict(path_prefix='solutions/', model_class=UserSolution),
        name='download_solution'),
)
