models.py 682 B

123456789101112131415161718192021222324252627
  1. from django.db import models
  2. from glitchtip.base_models import CreatedModel
  3. class DebugInformationFile(CreatedModel):
  4. """
  5. It hold info of the uploaded debug information file
  6. """
  7. class Meta:
  8. indexes = [
  9. models.Index(fields=["project", "file"])
  10. ]
  11. name = models.TextField()
  12. project = models.ForeignKey("projects.Project", on_delete=models.CASCADE)
  13. file = models.ForeignKey("files.File", on_delete=models.CASCADE)
  14. data = models.JSONField(null=True, blank=True)
  15. def is_proguard_mapping(self):
  16. try:
  17. return self.data["symbol_type"] == "proguard"
  18. except Exception:
  19. return False