enu"> Issues 0 Pull Requests 0 Commits 1200 Releases 0

No Description

0006_auto_20160901_1439.py 1.7KB

    # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('pay', '0005_remove_orderinfo_to_lid'), ] operations = [ migrations.AddField( model_name='orderinfo', name='photo_status', field=models.IntegerField(default=0, help_text='\u8d2d\u4e70\u7167\u7247\u72b6\u6001, \u6807\u8bc6\u7528\u6237\u662f\u5426\u5df2\u7ecf\u83b7\u5f97\u7167\u7247', db_index=True, verbose_name='photo_status', choices=[(0, '\u5f85\u4e0a\u4f20'), (1, '\u5df2\u4e0a\u4f20'), (2, '\u5df2\u5220\u9664')]), ), migrations.AddField( model_name='orderinfo', name='reback_at', field=models.DateTimeField(help_text='\u9000\u6b3e\u65f6\u95f4', null=True, verbose_name='reback_at', blank=True), ), migrations.AddField( model_name='orderinfo', name='reback_status', field=models.BooleanField(default=False, help_text='\u9000\u6b3e\u72b6\u6001', db_index=True, verbose_name='reback_status'), ), migrations.AddField( model_name='orderinfo', name='session_id', field=models.CharField(max_length=255, blank=True, help_text='\u7167\u7247\u7ec4\u552f\u4e00\u6807\u8bc6\uff0c\u540c PhotosInfo \u8868', null=True, verbose_name='session_id', db_index=True), ), migrations.AlterField( model_name='orderinfo', name='photo_type', field=models.IntegerField(default=0, help_text='\u8d2d\u4e70\u7167\u7247\u7c7b\u578b', db_index=True, verbose_name='photo_type', choices=[(0, '\u53bb\u9664\u6c34\u5370'), (1, '\u83b7\u53d6\u9ad8\u6e05\u56fe')]), ), ]
:art: os.remove · 92eeaae64b - Gogs: Go Git Service

:art: os.remove

huangqimin001 6 jaren geleden
bovenliggende
commit
92eeaae64b
1 gewijzigde bestanden met toevoegingen van 5 en 2 verwijderingen
  1. 5 2
      commands/management/commands/qiniu.py

+ 5 - 2
commands/management/commands/qiniu.py

@@ -1,6 +1,7 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3 3
 import logging
4
+import os
4 5
 
5 6
 from django_six import CompatibilityBaseCommand, close_old_connections
6 7
 
@@ -16,10 +17,10 @@ logger = logging.getLogger('console')
16 17
 class Command(CompatibilityBaseCommand):
17 18
     def handle(self, *args, **options):
18 19
 
19
-        logger.info('SubscribeUserInfo is dealing')
20
+        logger.info('Upload image qiniu is dealing')
20 21
 
21 22
         while True:
22
-            # r.rpushjson('SUBSCRIBE_USERINFO_LIST', {
23
+            # r.rpushjson('QINIU_UPLOAD_LIST', {
23 24
             #    'model': 'SaleclerkSubmitLogInfo',
24 25
             #    'pk': 'pk',
25 26
             # })
@@ -42,12 +43,14 @@ class Command(CompatibilityBaseCommand):
42 43
                 if ssli.image:
43 44
                     try:
44 45
                         upload_file_path(ssli.image.path, key=ssli.image.name, bucket='tamron')
46
+                        os.remove(ssli.image.path)
45 47
                     except:
46 48
                         pass
47 49
 
48 50
                 if ssli.code_image:
49 51
                     try:
50 52
                         upload_file_path(ssli.code_image.path, key=ssli.code_image.name, bucket='tamron')
53
+                        os.remove(ssli.code_image.path)
51 54
                     except:
52 55
                         pass
53 56