Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter unique_together for exporter #264

Closed
wants to merge 1 commit into from

Conversation

shokada
Copy link
Contributor

@shokada shokada commented Mar 31, 2020

No description provided.

@shokada shokada added the wip label Mar 31, 2020
@codecov-io
Copy link

Codecov Report

Merging #264 into master will increase coverage by 0.08%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #264      +/-   ##
==========================================
+ Coverage   47.20%   47.29%   +0.08%     
==========================================
  Files          56       57       +1     
  Lines        2646     2660      +14     
==========================================
+ Hits         1249     1258       +9     
- Misses       1397     1402       +5     
Impacted Files Coverage Δ
promgen/models.py 28.95% <0.00%> (ø)
promgen/views.py 47.86% <25.00%> (-0.14%) ⬇️
promgen/forms.py 91.07% <66.66%> (-1.39%) ⬇️
.../migrations/0020_alter_unique_together_exporter.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb5aff5...8548114. Read the comment docs.

@kfdm
Copy link
Collaborator

kfdm commented Mar 31, 2020

Looks like this was broken in #259 when the BaseExporter model was refactored.

@@ -349,7 +349,7 @@ class Exporter(BaseExporter):

class Meta:
ordering = ["job", "port"]
unique_together = (("job", "port", "path"),)
unique_together = (("job", "port", "path", "scheme", "project"),)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the unique_together (and the migration) are the only changes required. What is the reason for the other changes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set project in unique_together, but the validation doesn't work because project is not set in the form.
So, I added get_form_kwargs and full_clean by referring to the following.
https://stackoverflow.com/a/32261039

@shokada shokada removed the wip label Apr 9, 2020
@shokada shokada closed this Jun 12, 2020
@shokada shokada deleted the alter_unique_together branch June 12, 2020 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants