Skip to content
New issue

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

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

Already on GitHub? # to your account

Create initial revision on contest/problem clone #1679

Merged
merged 1 commit into from
May 8, 2021

Conversation

Ninjaclasher
Copy link
Member

Done to match the initial revision created when a contest/problem is create on the admin site.

@codecov-commenter
Copy link

Codecov Report

Merging #1679 (bc55a53) into master (27f475c) will decrease coverage by 0.02%.
The diff coverage is 11.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1679      +/-   ##
==========================================
- Coverage   46.41%   46.39%   -0.03%     
==========================================
  Files         216      216              
  Lines       12341    12351      +10     
==========================================
+ Hits         5728     5730       +2     
- Misses       6613     6621       +8     
Impacted Files Coverage Δ
judge/views/problem.py 25.10% <9.09%> (-0.06%) ⬇️
judge/views/contests.py 29.96% <12.50%> (-0.10%) ⬇️

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 27f475c...bc55a53. Read the comment docs.

@kiritofeng kiritofeng requested review from quantum5, WallE256 and Xyene May 8, 2021 16:50
Copy link
Member

@kiritofeng kiritofeng left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

problem.contest = contest
problem.pk = None
ContestProblem.objects.bulk_create(contest_problems)
with transaction.atomic(), revisions.create_revision():
Copy link
Member

Choose a reason for hiding this comment

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

Does revisions.create_revision(atomic=True) work?

Copy link
Member

Choose a reason for hiding this comment

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

I checked the code and it does work, but I don't think it makes a difference which way you use.

@quantum5 quantum5 merged commit e24e2ea into DMOJ:master May 8, 2021
@Ninjaclasher Ninjaclasher deleted the clone-revision branch May 9, 2021 19:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants