Commit 0f977514 authored by Michal Čihař's avatar Michal Čihař

Block online change of a vcs

This could work, but the problem is that before changed object is saved
the linked repos still see old vcs leading to horrible mess.  Changing
vcs from the manage.py shell works fine though.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent d8a96b63
......@@ -1070,6 +1070,15 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
old = SubProject.objects.get(pk=self.id)
self.check_rename(old)
if old.vcs != self.vcs:
# This could work, but the problem is that before changed
# object is saved the linked repos still see old vcs leading
# to horrible mess. Changing vcs from the manage.py shell
# works fine though.
raise ValidationError(
_('Changing version control system is not supported!')
)
# Check file format
if self.file_format not in FILE_FORMATS:
raise ValidationError(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment