[damned-lies] Defer update_doap_infos after branches have been created
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Defer update_doap_infos after branches have been created
- Date: Thu, 8 Oct 2020 21:05:13 +0000 (UTC)
commit c98d42fbc979fae9f71bf7b4a2d763bd572d6f26
Author: Claude Paroz <claude 2xlibre net>
Date: Thu Oct 8 23:05:02 2020 +0200
Defer update_doap_infos after branches have been created
stats/admin.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/stats/admin.py b/stats/admin.py
index 06c19409..1bcd679b 100644
--- a/stats/admin.py
+++ b/stats/admin.py
@@ -93,7 +93,6 @@ class ModuleForm(forms.ModelForm):
for branch in instance.get_branches():
# Force checkout and updating stats
branch.save()
- update_doap_infos(instance)
return instance
@@ -121,9 +120,16 @@ class ModuleAdmin(admin.ModelAdmin):
return field
+ def save_related(self, request, form, *args, **kwargs):
+ super().save_related(request, form, *args, **kwargs)
+ # Here, branches should have been created.
+ update_doap_infos(form.instance)
+
+
class BranchAdmin(admin.ModelAdmin):
search_fields = ('name', 'module__name')
+
class DomainAdmin(admin.ModelAdmin):
form = DomainForm
list_display = ('__str__', 'layout', 'pot_method')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]