From: Guillaume Pellerin Date: Tue, 24 Jan 2017 21:08:44 +0000 (+0100) Subject: Fix url X-Git-Tag: 1.1~30 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=703e7b6623a7b022dba5b525d1c5f9ac343873fd;p=teleforma.git Fix url --- diff --git a/teleforma/exam/admin.py b/teleforma/exam/admin.py index d069edd4..15ec9314 100644 --- a/teleforma/exam/admin.py +++ b/teleforma/exam/admin.py @@ -58,8 +58,9 @@ class ScriptAdmin(admin.ModelAdmin): script.corrector = None script.date_marked = None script.date_rejected = None + script.url = '' script.save() - + force_resubmit.short_description = "Re-submit scripts" diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index a919475f..e93176bd 100644 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -345,6 +345,8 @@ class Script(BaseResource): if not os.path.exists(new_abs): os.symlink(old_abs, new_abs) # self.url = 'http://teleforma.parisson.com/media/scripts/2014/06/24/Gstreamer_monitoring_Pipleline.pdf' + + if not self.url: self.url = settings.MEDIA_URL + unicode(new_rel) self.save()