djgentelella 0.4.1__py3-none-any.whl → 0.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
djgentelella/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = '0.4.1'
1
+ __version__ = '0.4.2'
2
2
 
3
3
  if __name__ == '__main__':
4
4
  print(__version__)
@@ -70,8 +70,19 @@ class DigitalSignatureRenderFileAPIView(APIView):
70
70
  return Response(file_data, content_type='application/pdf')
71
71
 
72
72
  def get_instance_file(self, instance, fieldname):
73
+ # check if instance and fieldname are not None
74
+ if not instance or not fieldname:
75
+ return None
76
+
73
77
  file_path = getattr(instance, fieldname)
74
- file_data = None
75
- with open(file_path.path, 'rb') as f:
76
- file_data = f.read()
77
- return file_data
78
+ if not file_path:
79
+ return None
80
+
81
+ # check if not file
82
+ try:
83
+ with open(file_path.path, 'rb') as f:
84
+ file_data = f.read()
85
+
86
+ return file_data
87
+ except (FileNotFoundError, OSError):
88
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: djgentelella
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Help building extra widgets for forms and speciall methods to render forms in templates
5
5
  Author-email: Solvosoft <info@solvosoft.com>
6
6
  Maintainer-email: Luis Zarate Montero <luis.zarate@solvosoft.com>
@@ -1,4 +1,4 @@
1
- djgentelella/__init__.py,sha256=AN5qkZ934CRY4ViLGs4cOscdRDn0nmJKbPUEWCK9r28,73
1
+ djgentelella/__init__.py,sha256=HE_MExHBudti_JND0IRj20MdymtZ69yjO1WihyCFMW4,73
2
2
  djgentelella/admin.py,sha256=hFPWtRyTZWYtuKEv-SZ3r6lHw3aissX0ObqxYmxblY0,1531
3
3
  djgentelella/apps.py,sha256=5VEbpUv4b1Jh7gCRAQCe5TvpakRyndKwafjVj0z-Xfo,153
4
4
  djgentelella/chartjs.py,sha256=iNYoFnaIQoXsYInJFbSE2quWpjmDz5CuMKpVsvt4pRM,8572
@@ -59,7 +59,7 @@ djgentelella/firmador_digital/forms.py,sha256=NGcpQOI1eUq3An5aYLI2eFjXH28nuaqMYb
59
59
  djgentelella/firmador_digital/models.py,sha256=i6odjdzP3hvAi31gIKJq6sqYkcCWf_78igEAk4_6mw4,1035
60
60
  djgentelella/firmador_digital/signvalue_utils.py,sha256=Nh8v8AkmAjWXOP9hcc9pVNhzJZpTnHwJ1a9dnWqTWTo,1320
61
61
  djgentelella/firmador_digital/utils.py,sha256=jlJorQh8cC8iJCe5gXS3d-mR_GK8_XjaKEq4GeZ5Zbc,5354
62
- djgentelella/firmador_digital/viewsets.py,sha256=UetqF6U83OI8MCoh804GABEvzCqEs2B3uUL5uJIPFhc,3003
62
+ djgentelella/firmador_digital/viewsets.py,sha256=caxoifIMe1UHh61wmHjpRoBcyga08B8uViQgGZIVYsY,3274
63
63
  djgentelella/firmador_digital/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  djgentelella/firmador_digital/config/asgi_config.py,sha256=mGWMKpdgoqL28MTwuQTEHtf3JJYxah3-Uguddd9p3DM,1071
65
65
  djgentelella/firmador_digital/config/asgi_worker.py,sha256=r8CLU1L04hIZ2xCUb-l0jf5q2p1AMTL6z8YVEabsWTQ,188
@@ -1030,9 +1030,9 @@ djgentelella/widgets/trees.py,sha256=bV6s-w1cgYahS0aNU6xBrx-aISdlzDZ23BFt3_3hAu4
1030
1030
  djgentelella/widgets/wysiwyg.py,sha256=wHeMyYNVE8-lKJ06A-0DLDAcRNv3TOAOG_Wl9DYZqS0,609
1031
1031
  djgentelella/wysiwyg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1032
1032
  djgentelella/wysiwyg/views.py,sha256=tI7LjLhCnohdvIEOEEhB2Cu1zxRmdcOhYJJX4LBIZaA,1159
1033
- djgentelella-0.4.1.dist-info/AUTHORS,sha256=HyQoO-q7oXtavpNm7jaBVv8Vxx3c7yo33xkFkt4blkY,118
1034
- djgentelella-0.4.1.dist-info/LICENSE.txt,sha256=wDzqAntLQORAL6vQhVdzZyfsPVvFStZKtkct5DIZjK0,18047
1035
- djgentelella-0.4.1.dist-info/METADATA,sha256=JO80rYI3ePNVv-I3srWEE5bH_aPHUB16dccb5NY2RwA,27544
1036
- djgentelella-0.4.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1037
- djgentelella-0.4.1.dist-info/top_level.txt,sha256=88JbODVPV-P5q7ic25yMHt_FuuizaLzMyIaegpFa7Qk,13
1038
- djgentelella-0.4.1.dist-info/RECORD,,
1033
+ djgentelella-0.4.2.dist-info/AUTHORS,sha256=HyQoO-q7oXtavpNm7jaBVv8Vxx3c7yo33xkFkt4blkY,118
1034
+ djgentelella-0.4.2.dist-info/LICENSE.txt,sha256=wDzqAntLQORAL6vQhVdzZyfsPVvFStZKtkct5DIZjK0,18047
1035
+ djgentelella-0.4.2.dist-info/METADATA,sha256=JSeHP7IbPfUxHX6bAHGFYadz3vD0GC5xlWnTjGW-X1Q,27544
1036
+ djgentelella-0.4.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1037
+ djgentelella-0.4.2.dist-info/top_level.txt,sha256=88JbODVPV-P5q7ic25yMHt_FuuizaLzMyIaegpFa7Qk,13
1038
+ djgentelella-0.4.2.dist-info/RECORD,,