7712: Cherry-pick [321821] and [2dd0c9] from master.
This commit is contained in:
parent
442663f53a
commit
f104408968
@ -290,11 +290,8 @@ class EditMedia(EditPrimary):
|
|||||||
return
|
return
|
||||||
|
|
||||||
path = conv_to_unicode(self.file_path.get_text())
|
path = conv_to_unicode(self.file_path.get_text())
|
||||||
ref_obj = self.dbstate.db.get_object_from_handle(self.obj.handle)
|
full_path = media_path_full(self.db, path)
|
||||||
if ref_obj:
|
if os.path.isfile(full_path):
|
||||||
media_path = media_path_full(self.dbstate.db,
|
|
||||||
ref_obj.get_path())
|
|
||||||
if os.path.exists(os.path.join(os.path.dirname(media_path), path)):
|
|
||||||
self.determine_mime()
|
self.determine_mime()
|
||||||
else:
|
else:
|
||||||
msg1 = _("There is no media matching the current path value!")
|
msg1 = _("There is no media matching the current path value!")
|
||||||
@ -306,7 +303,7 @@ class EditMedia(EditPrimary):
|
|||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.obj.set_path(conv_to_unicode(path))
|
self.obj.set_path(path)
|
||||||
|
|
||||||
with DbTxn('', self.db) as trans:
|
with DbTxn('', self.db) as trans:
|
||||||
if not self.obj.get_handle():
|
if not self.obj.get_handle():
|
||||||
|
Loading…
Reference in New Issue
Block a user