Révision 6d9b70dc
Ajouté par Benjamin Dauvergne il y a plus de 10 ans
wcsinst/wcsinst/models.py | ||
---|---|---|
59 | 59 |
'site_options_cfg': self.site_options_cfg(), |
60 | 60 |
} |
61 | 61 |
|
62 |
def save(self, *args, **kwargs): |
|
63 |
created = (self.id is None) |
|
64 |
super(WcsInstance, self).save(*args, **kwargs) |
|
62 |
def notify(self, created=True): |
|
65 | 63 |
# notify wcsinstd |
66 | 64 |
if not settings.WCSINSTD_URL: |
67 | 65 |
return |
... | ... | |
86 | 84 |
out_data = p.read() |
87 | 85 |
p.close() |
88 | 86 |
|
87 |
def save(self, *args, **kwargs): |
|
88 |
created = (self.id is None) |
|
89 |
super(WcsInstance, self).save(*args, **kwargs) |
|
90 |
self.notify(created) |
|
91 |
|
|
89 | 92 |
class Meta: |
90 | 93 |
verbose_name = _('wcs instance') |
91 | 94 |
verbose_name_plural = _('wcs instances') |
Formats disponibles : Unified diff
models: factorize the WcsInstance notification code in a method