Revert last 3 commits

This commit is contained in:
cuom1999 2022-10-07 12:17:07 -05:00
parent 87e8f3d966
commit dfc12f81f2
20 changed files with 486 additions and 272 deletions

View file

@ -98,13 +98,7 @@ class BlogPost(models.Model):
return self.title
def get_absolute_url(self):
try:
BlogPost.objects.get(id=self.id)
return reverse("blog_post", args=(self.id , self.slug))
except BlogPost.DoesNotExist:
return reverse("organization_pending_blogs",
args=(self.organizations.first().pk, self.organizations.first().slug))
return reverse("blog_post", args=(self.id , self.slug))
def can_see(self, user):
if self.visible and self.publish_on <= timezone.now():
if not self.is_organization_private:

View file

@ -152,19 +152,21 @@ class ProblemData(models.Model):
if e.errno != errno.ENOENT:
raise
if self.zipfile:
self.zipfile.name = _problem_directory_file(new, self.zipfile.name)
self.zipfile.name = problem_directory_file_helper(new, self.zipfile.name)
if self.generator:
self.generator.name = _problem_directory_file(new, self.generator.name)
self.generator.name = problem_directory_file_helper(
new, self.generator.name
)
if self.custom_checker:
self.custom_checker.name = _problem_directory_file(
self.custom_checker.name = problem_directory_file_helper(
new, self.custom_checker.name
)
if self.custom_checker:
self.custom_checker.name = _problem_directory_file(
self.custom_checker.name = problem_directory_file_helper(
new, self.custom_checker.name
)
if self.custom_validator:
self.custom_validator.name = _problem_directory_file(
self.custom_validator.name = problem_directory_file_helper(
new, self.custom_validator.name
)
self.save()