Skip to content

Commit

Permalink
fix: 修复python3问题完成
Browse files Browse the repository at this point in the history
  • Loading branch information
biheng committed Dec 22, 2020
1 parent c20f6d3 commit 2be8159
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion models.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class UpFile(models.Model):
upload_to=icon_path) # 大图标
plist = models.FileField(upload_to=ipapub.PACKAGE_DIR) # plist文件
pub = models.FileField(upload_to=ipapub.PACKAGE_DIR) # 发布的文件压缩包集合
signed = ContentTypeRestrictedFileField(content_types=['application/iphone'],
signed = ContentTypeRestrictedFileField(content_types=['application/iphone', 'application/octet-stream'],
max_upload_size=104857600,
upload_to=icon_path, blank=True, null=True) # 签名好的文件
status = models.CharField(max_length=10, blank=True) # 状态,uploaded,。。。
Expand Down
2 changes: 1 addition & 1 deletion templates/ipapub/upfile_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<dl class="dl-horizontal">
<dt>安装:</dt>
<dd>
<a href="itms-services://?action=download-manifest%26url={{ basedir }}{{ object.plist.url }}" type="text/plain">{{ upfile.path }}</a>
<a href="itms-services://?action=download-manifest&url={{ basedir }}{{ object.plist.url }}" type="text/plain">{{ upfile.path }}</a>
</dd>


Expand Down
4 changes: 2 additions & 2 deletions urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.urls import path
from django.urls import path, re_path
from django.views.generic import FormView
from .views import upload, AllView, OneView
from .forms import UploadModelFileForm
Expand All @@ -7,5 +7,5 @@
urlpatterns = [
path('', upload, name='upload'),
path('all', AllView.as_view(), name='all'),
path('<path>', OneView.as_view(), name='one'),
re_path('^(?P<path>.*)$', OneView.as_view(), name='one'), # 需要读取多段路径,只能采用re_path
]
4 changes: 2 additions & 2 deletions views.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def upload(request):
"iconbigurl": urljoin(current_uri, join(settings.MEDIA_URL, o.iconb.url)),
}
f.write(rule_repl.sub(lambda mt: gens[mt.group(2).lower()] if mt.group(2).lower(
) in gens else mt.group(1) + mt.group(2) + mt.group(3), request.POST['plist']).encode('utf-8'))
) in gens else mt.group(1) + mt.group(2) + mt.group(3), request.POST['plist']))
f.close()
o.plist.name = path_plist_rela
o.save()
Expand All @@ -123,7 +123,7 @@ def upload(request):
"iconbigurl": request.POST['iconbigurl'] if 'iconbigurl' in request.POST else '',
}
f.write(rule_repl.sub(lambda mt: gens[mt.group(2).lower()] if mt.group(2).lower(
) in gens else mt.group(1) + mt.group(2) + mt.group(3), request.POST['plist']).encode('utf-8'))
) in gens else mt.group(1) + mt.group(2) + mt.group(3), request.POST['plist']))
f.close()

path_zip_rela = splitext(path_rela)[0] + '.zip'
Expand Down

0 comments on commit 2be8159

Please sign in to comment.